diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin.pm index 9f233ea..e7bf779 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin.pm @@ -1,20 +1,4 @@ -# -# Copyright (C) 2002 Motorola - All rights reserved -# Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk -# -# Extension that adds tags for action tracking -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details, published at -# http://www.gnu.org/copyleft/gpl.html -# +# See bottom of file for license and copyright information package Foswiki::Plugins::ActionTrackerPlugin; use strict; @@ -278,12 +262,10 @@ sub afterEditHandler { my $pretext = $query->param('pretext') || ""; - # Fix from RichardBaar 8/10/03 for Mozilla my $char = chop($pretext); $pretext .= $char if ( $char ne "\n" ); $pretext .= "\n"; - # end of fix from RichardBaar 8/10/03 my $posttext = $query->param('posttext') || ""; # count the previous actions so we get the right action number @@ -294,8 +276,8 @@ sub afterEditHandler { } my $action = - Foswiki::Plugins::ActionTrackerPlugin::Action::createFromQuery( $_[2], - $_[1], $an, $query ); + Foswiki::Plugins::ActionTrackerPlugin::Action::createFromQuery( + $_[2], $_[1], $an, $query ); $action->populateMissingFields(); @@ -317,7 +299,7 @@ sub beforeSaveHandler { return unless lazyInit( $web, $topic ); my $query = Foswiki::Func::getCgiQuery(); - return unless ($query); # Fix from GarethEdwards 13 Jun 2003 + return unless ($query); if ( $query->param('closeactioneditor') ) { @@ -438,11 +420,11 @@ sub lazyInit { return 1 if $initialised; Foswiki::Plugins::JQueryPlugin::registerPlugin( - "ActionTracker", + 'ActionTracker', 'Foswiki::Plugins::ActionTrackerPlugin::JQuery'); unless( Foswiki::Plugins::JQueryPlugin::createPlugin( - "ActionTracker", $Foswiki::Plugins::SESSION )) { - die "Fucking POOF"; + 'ActionTracker', $Foswiki::Plugins::SESSION )) { + die 'Failed to register JQuery plugin'; } require Foswiki::Attrs; @@ -565,3 +547,19 @@ sub _updateSingleAction { } 1; +__END__ + +Copyright (C) 2002-2003 Motorola UK Ltd - All rights reserved +Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html + diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm index e2655a3..9dddaac 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm @@ -886,6 +886,7 @@ sub _formatField_edit { nowysiwyg => 1, # SMELL: could do better! t => time() ); + $url =~ s/%2c/,/g; my $attrs = { href => $url, title => 'Edit', class => "atp_edit ui-icon ui-icon-pencil" }; return CGI::a( $attrs, 'edit' ); @@ -1059,19 +1060,19 @@ sub formatForEdit { } 1; -__DATA__ -# -# Copyright (C) 2002-2003 Motorola UK Ltd - All rights reserved -# Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details, published at -# http://www.gnu.org/copyleft/gpl.html -# +__END__ + +Copyright (C) 2002-2003 Motorola UK Ltd - All rights reserved +Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html + diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm index 212894a..dacd26c 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm @@ -1,19 +1,4 @@ -# -# Copyright (C) Motorola 2002 - All rights reserved -# -# Extension that adds tags for action tracking -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details, published at -# http://www.gnu.org/copyleft/gpl.html -# +# See bottom of file for copyright and license information # This module contains the functionality of the bin/actionnotify script package Foswiki::Plugins::ActionTrackerPlugin::ActionNotify; @@ -512,3 +497,18 @@ sub _findChangesInWebs { } 1; +__END__ +Copyright (C) Motorola 2002 - All rights reserved +Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html + diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm index 2f0f91e..8705d5d 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm @@ -1,17 +1,4 @@ -# -# Copyright (C) Motorola 2002 - All rights reserved -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details, published at -# http://www.gnu.org/copyleft/gpl.html -# +# See bottom of file for license and copyright information # Perl object that represents a set of actions (possibly interleaved # with blocks of topic text) @@ -409,3 +396,17 @@ sub splitOnAction { } 1; +__END__ +Copyright (C) Motorola 2002 - All rights reserved +Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/AttrDef.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/AttrDef.pm index ad39620..d371676 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/AttrDef.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/AttrDef.pm @@ -1,17 +1,5 @@ -# -# Copyright (C) Motorola 2002 - All rights reserved -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details, published at -# http://www.gnu.org/copyleft/gpl.html -# +# See bottom of file for license and copyright information + use strict; use integer; @@ -57,3 +45,17 @@ sub isRedefinable { } 1; +__END__ +Copyright (C) Motorola 2002 - All rights reserved +Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm index 7944e81..e5039c4 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm @@ -1,18 +1,5 @@ -# -# Copyright (C) Motorola 2002 - All rights reserved -# Copyright (C) 2004-2009 Crawford Currie http://c-dot.co.uk -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details, published at -# http://www.gnu.org/copyleft/gpl.html -# +# See bottom of file for license and copyright information + # Object that represents a header and fields format # This is where all formatting should be done; there should # be no HTML tags anywhere else in the code! @@ -450,3 +437,17 @@ sub formatHidden { } 1; +__END__ +Copyright (C) Motorola 2002 - All rights reserved +Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/JQuery.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/JQuery.pm new file mode 100644 index 0000000..3ea73f5 --- /dev/null +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/JQuery.pm @@ -0,0 +1,47 @@ +# See bottom of file for license and copyright information + +package Foswiki::Plugins::ActionTrackerPlugin::JQuery; +use strict; + +use Assert; + +use Foswiki::Plugins::JQueryPlugin::Plugin; +our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin ); + +sub new { + my $class = shift; + my $session = shift || $Foswiki::Plugins::SESSION; + my $src = (DEBUG) ? '_src' : ''; + + my $this = $class->SUPER::new( + $session, + name => 'ActionTracker', + version => '1.0', + author => 'Crawford Currie', + homepage => 'http://foswiki.org/Extensions/ActionTrackerPlugin', + puburl => '%PUBURLPATH%/%SYSTEMWEB%/ActionTrackerPlugin', + # CSS is added in ActionTracker.pm + css => [ ], + documentation => "$Foswiki::cfg{SystemWebName}.ActionTrackerPlugin", + javascript => ["atp${src}.js"], + dependencies => ['UI'], + ); + + return $this; +} + +1; +__END__ + +Copyright (C) 2011 Crawford Currie http://c-dot.co.uk + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST b/lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST index 3e6db8f..4ce644d 100755 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST @@ -10,6 +10,7 @@ pub/System/ActionTrackerPlugin/wikiringlogo20x20.png 0660 tools/actionnotify 0555 Mailer script templates/actionnotify.tmpl 0440 Page template for notify message templates/edit.action.tmpl 0440 Action editor page template +templates/login.action.tmpl 0440 Action login page template templates/actionform.tmpl 0440 Action editor page subtemplate lib/Foswiki/Plugins/ActionTrackerPlugin.pm 0440 Plugin Perl module lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm 0440 Perl support module diff --git a/lib/Foswiki/Plugins/ActionTrackerPlugin/Options.pm b/lib/Foswiki/Plugins/ActionTrackerPlugin/Options.pm index 8d66933..8ccf2e1 100644 --- a/lib/Foswiki/Plugins/ActionTrackerPlugin/Options.pm +++ b/lib/Foswiki/Plugins/ActionTrackerPlugin/Options.pm @@ -45,18 +45,18 @@ sub load { } 1; -__DATA__ +__END__ - Copyright (C) 2007 Crawford Currie http://c-dot.co.uk +Copyright (C) 2007-2011 Crawford Currie http://c-dot.co.uk - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details, published at - http://www.gnu.org/copyleft/gpl.html +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details, published at +http://www.gnu.org/copyleft/gpl.html diff --git a/pub/System/ActionTrackerPlugin/atp_src.js b/pub/System/ActionTrackerPlugin/atp_src.js index 6e91ee1..b8a7a8a 100755 --- a/pub/System/ActionTrackerPlugin/atp_src.js +++ b/pub/System/ActionTrackerPlugin/atp_src.js @@ -39,10 +39,28 @@ }); $('#atp_editor input[type="submit"]').livequery(function() { - $(this).button(); $(this).click(function() { $("#atp_editor").dialog("close"); return true; }); }); + + $("#atp_editor form[name='loginform']").livequery("submit", + function() { + var form = $(this); + $.ajax({ + url: form.attr("action"), + data: form.serialize(), + success: function(d, t, r) { + // Dialog will have been closed by the submit. That's + // OK, as we want to relayout anyway. + $("#atp_editor").html(d).dialog("open"); + }, + error: function(r, t, e) { + // IE fails validation of the login + alert("Buggeration"); + } + }); + return false; + }); })(jQuery); diff --git a/templates/login.action.tmpl b/templates/login.action.tmpl new file mode 100644 index 0000000..5c3c18f --- /dev/null +++ b/templates/login.action.tmpl @@ -0,0 +1,7 @@ +%{ This is used in a modal dialog, so disable the standard page furniture }% +%TMPL:INCLUDE{"login"}% +%TMPL:DEF{"main"}%%TMPL:P{"content"}%%TMPL:END% +%TMPL:DEF{"htmldoctype"}%%TMPL:END% +%TMPL:DEF{"head"}%%TMPL:END% +%TMPL:DEF{"bodystart"}%%TMPL:END% +%TMPL:DEF{"bodyend"}%%TMPL:END% \ No newline at end of file diff --git a/tools/actionnotify b/tools/actionnotify index 0dbe53a..911e782 100644 --- a/tools/actionnotify +++ b/tools/actionnotify @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # # Copyright (C) 2002 Motorola - all rights reserved -# Copyright (C) 2004-2006 Crawford Currie http://c-dot.co.uk +# Copyright (C) 2004-2011 Crawford Currie http://c-dot.co.uk # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License