Changeset 2227
- Timestamp:
- 01/29/09 15:09:14 (3 years ago)
- Location:
- trunk/ActionTrackerPlugin
- Files:
-
- 1 added
- 1 deleted
- 6 edited
-
data/System/ActionTrackerPlugin.txt (modified) (5 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin.pm (modified) (4 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm (modified) (3 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm (modified) (5 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST (modified) (1 diff)
-
pub/System/ActionTrackerPlugin/juggle.gif (deleted)
-
pub/System/ActionTrackerPlugin/logo.png (added)
-
test/unit/ActionTrackerPlugin/ActionTests.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ActionTrackerPlugin/data/System/ActionTrackerPlugin.txt
r2226 r2227 10 10 --> 11 11 <div style="float:right"> 12 <a href="http://wikiring.com"><img src="%ATTACHURLPATH%/ juggle.gif" title="WikiRing: Professional Wiki Innovation and Support" /></a>12 <a href="http://wikiring.com"><img src="%ATTACHURLPATH%/logo.png" title="WikiRing: Professional Wiki Innovation and Support" /></a> 13 13 </div> 14 It takes the skills of a juggler to keep track of all the demands that modern life makes on us. Wouldn't it be great if we could capture what we have to do _at the time we think of it_, and be able to get a to-do list on demand? No more fighting with post-it notes, no more forgetting actions from the minutes of obscure meetings, and remember your partners birthday every year into the bargain! 15 16 This plugin provides support for tracking actions embedded in topics. Actions captured this way can then be tracked from anywhere you want. 17 18 This is particularly useful for [[http://en.wikipedia.org/wiki/Minutes][meeting minutes]]. As you write the minutes during the meeting, you simply enter the actions into the text and as soon as the topic is saved, the actions "go live". For example, at a recent meeting of the British Cabinet: 14 This plugin provides support for tracking actions embedded in topics. Actions captured this way can then be searched from any topic in the wiki. 15 16 ---+ Features 17 * Actions are be embedded in topics. 18 * List actions using searches. 19 * Automatic e-mail notification of changes. 20 * Assign actions to individuals, or to predefined groups. 21 * Pop-up action editor. 22 * Fully configurable - add your own action attributes. 23 24 This plugin is particularly useful for [[http://en.wikipedia.org/wiki/Minutes][meeting minutes]]. As you write the minutes during the meeting, you simply enter the actions into the text, and as soon as the topic is saved, the actions "go live". 25 For example, at a recent meeting of the British Cabinet: 19 26 <verbatim> 20 27 GordonBrown agreed to a zero tax rate for all self-employed software engineers, to make up for past unfair treatment. … … 29 36 Actions are nicely formatted for display, and automatic notification of actions is supported using 'cron'. 30 37 38 Actions are _embedded into topics_ so you can easily edit them, and even process them with other tools. No separate database to worry about! 39 31 40 %TOC% 32 33 ---+ Features34 * Actions can be embedded in topics.35 * Actions can be listed using searches.36 * Automatic action state e-mail notification.37 * Actions can be assigned to individuals, or to predefined groups.38 * Fully configurable.39 41 40 42 --- … … 342 344 </pre> 343 345 ---++ Formatting how actions are displayed 344 The format of an action output. The following fields can be output: =web=, =topic=, =text=, =who=, =due=, =notify=, =uid=, =creator=, =state=, =edit=, and any =ACTIONTRACKERPLUGIN_EXTRAS= you may have. These settings can be overridden in an =ACTIONSEARCH= command using the =format= and =header= attributes. =TABLEHEADER= defines the column headings, =TABLEFORMAT= defines the contents of the columns, and if =TABLEORIENT= is set to =rows=, action tables will be aligned as rows of values instead of the default columns of values.346 The default format of an action output, unless overridden by =format=, =header= etc. The following fields can be output: =web=, =topic=, =text=, =who=, =due=, =notify=, =uid=, =creator=, =state=, =edit=, and any =ACTIONTRACKERPLUGIN_EXTRAS= you may have. =TABLEHEADER= defines the column headings, =TABLEFORMAT= defines the contents of the columns, and if =TABLEORIENT= is set to =rows=, action tables will be aligned as rows of values instead of the default columns of values. 345 347 * ACTIONTRACKERPLUGIN_TABLEHEADER =| Assigned to | Due date | Description | State | Notify ||= 346 348 * ACTIONTRACKERPLUGIN_TABLEFORMAT =| $who | $due | $text $link | $state | $notify | $edit |= … … 410 412 | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | 411 413 | Change History: | | 412 | 29 Jan 2009 | Foswikitask:Item455: port to foswiki Foswikitask:Item5974: correct CSS for search results table Foswikitask:Item5938: load CSS for ACTIONSEARCH Foswikitask:Item5606: Foswikitask:Item5915: respect global settings for time format |414 | 29 Jan 2009 | Foswikitask:Item455: port to foswiki Foswikitask:Item5974: correct CSS for search results table Foswikitask:Item5938: load CSS for ACTIONSEARCH Foswikitask:Item5606: Foswikitask:Item5915: respect global settings for time format Foswikitask:Item4312: support for header, footer etc. Foswikitask:Item412: added =reverse= | 413 415 | 7 May 2008 | TWikibug:Item5607: http: was being doubled up on URLs in mail due to a core bug | 414 416 | 13 Apr 2008 | TWikibug:Item4649: merged TWiki:Main.JoaquinBuendia's fix for AJAX updates on IE. TWikibug:Item4760: fixed WYSIWYG editing of topics containing actions TWikibug:Item5531: added simple button option for state changes | … … 450 452 451 453 %META:FILEATTACHMENT{name="styles.css" attr="" comment="Stylesheet for actions"}% 452 %META:FILEATTACHMENT{name=" juggle.gif" attr="h" comment="Logo"}%454 %META:FILEATTACHMENT{name="logo.png" attr="h" comment="Logo"}% 453 455 %META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" version="1"}% -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin.pm
r2226 r2227 132 132 133 133 if( Foswiki::Func::getSkin() =~ /\baction\b/ ) { 134 print STDERR "Action edit\n";135 134 return _beforeActionEdit(@_); 136 135 } else { 137 print STDERR "Noamrl edit\n";138 136 return _beforeNormalEdit(@_); 139 137 } … … 411 409 my $orient = $attrs->remove( 'orient' ); 412 410 my $sort = $attrs->remove( 'sort' ); 411 my $reverse = $attrs->remove( 'reverse' ); 413 412 if ( defined( $fmts ) || defined( $hdrs ) || defined( $orient )) { 414 413 $fmts = $defaultFormat->getFields() unless ( defined( $fmts )); … … 421 420 422 421 my $actions = Foswiki::Plugins::ActionTrackerPlugin::ActionSet::allActionsInWebs( $web, $attrs, 0 ); 423 $actions->sort( $sort );422 $actions->sort( $sort, $reverse ); 424 423 return $actions->formatAsHTML( $fmt, 'href', $options->{USENEWWINDOW}, 425 424 'atpSearch' ); … … 440 439 }; 441 440 if ($@) { 441 print STDERR "ActionTrackerPlugin: init failed $@\n"; 442 442 Foswiki::Func::writeWarning("ActionTrackerPlugin: init failed $@"); 443 443 return 0; -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm
r2226 r2227 89 89 # of attributes by string value 90 90 sub sort { 91 my ( $this, $order ) = @_; 91 my ( $this, $order, $reverse ) = @_; 92 my @ordered; 92 93 if ( defined( $order ) ) { 93 94 $order =~ s/[^\w,]//g; 94 95 @_sortfields = split( /,\s*/, $order ); 95 @ {$this->{ACTIONS}}= sort {96 @ordered = sort { 96 97 foreach my $sf ( @_sortfields ) { 97 98 return -1 unless ref($a); … … 115 116 } @{$this->{ACTIONS}}; 116 117 } else { 117 @ {$this->{ACTIONS}}=118 @ordered = 118 119 sort { 119 120 my $x = $a->secsToGo(); … … 121 122 return $x <=> $y; 122 123 } @{$this->{ACTIONS}}; 124 } 125 if (Foswiki::Func::isTrue($reverse)) { 126 @{$this->{ACTIONS}} = reverse @ordered; 127 } else { 128 @{$this->{ACTIONS}} = @ordered; 123 129 } 124 130 } -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm
r2226 r2227 145 145 my $args = shift; 146 146 my $asHTML = shift; 147 if ( defined( &{ref( $object ) . "::_formatField_$vbl"} ) ) { 147 my $fn = "_formatField_$vbl"; 148 if ( $object->can($fn) ) { 148 149 # special format for this field 149 my $fn = "_formatField_$vbl";150 150 return $object->$fn( $args, $asHTML, @_ ); 151 151 } … … 153 153 if( $type ) { 154 154 my $typename = $type->{type}; 155 if ( defined( &{ref( $object ) . "::_formatType_$typename"} ) ) { 155 $fn = "_formatType_$typename"; 156 if ( $object->can($fn) ) { 156 157 # special format for this type 157 my $fn = "_formatType_$typename";158 158 return $object->$fn( $vbl, $args, $asHTML, @_ ); 159 159 } … … 169 169 return ''; 170 170 } 171 }172 173 # PRIVATE STATIC fill in variable expansions in simple text form174 sub _expandString {175 my $object = shift;176 my $var = shift;177 my $args = shift;178 179 if ( $var eq "dollar") {180 return "\$";181 } elsif ($var eq "nop") {182 return "";183 } elsif ($var eq "n") {184 return "\n";185 } elsif ($var eq "percnt") {186 return "%";187 } elsif ($var eq "quot") {188 return "\"";189 }190 my $t = _expandVar( $object, $var, $args, @_ );191 return $t;192 }193 194 # PUBLIC fill in the text template using values195 # extracted from the given object196 sub _formatAsString {197 my $this = shift;198 my $object = shift;199 200 my $fmt = $this->{TEXTFORM} || '';201 $fmt =~ s/\$(\w+\b)(?:\((.*?)\))?/202 _expandString( $object, $1, $2, 0, @_ )/geos;203 204 return $fmt;205 }206 207 # PRIVATE STATIC fill in variable expansions. If any of the expansions208 # returns a non-zero color, then fill in the passed-by-reference color209 # variable $col with the value returned.210 sub _expandHTML {211 my $object = shift;212 my $var = shift;213 my $args = shift;214 215 if ( $var eq "dollar") {216 return "\$";217 } elsif ($var eq "nop") {218 return "";219 } elsif ($var eq "n") {220 return CGI::br();221 } elsif ($var eq "percnt") {222 return "%";223 } elsif ($var eq "quot") {224 return "\"";225 }226 227 my $t = _expandVar( $object, $var, $args, @_ );228 229 return $t;230 171 } 231 172 … … 249 190 my $c; 250 191 my $entry = $i; 192 $entry = Foswiki::Func::decodeFormatTokens($entry); 251 193 $entry =~ s/\$(\w+)(?:\((.*?)\))?/ 252 _expand HTML( $object, $1, $2, 1, $jump, $newWindow )/ges;194 _expandVar( $object, $1, $2, 1, $jump, $newWindow )/ges; 253 195 if( !$anchored ) { 254 196 $entry = CGI::a( { name=>$object->getAnchor() } ).$entry; … … 306 248 my $text = ''; 307 249 foreach my $row ( @$data ) { 308 my $horzrow = $this->_formatAsString( $row, @_ ); 309 $text .= $horzrow."\n"; 250 my $fmt = $this->{TEXTFORM} || ''; 251 $fmt = Foswiki::Func::decodeFormatTokens($fmt); 252 $fmt =~ s/\$(\w+\b)(?:\((.*?)\))?/ 253 _expandVar( $row, $1, $2, 0, @_ )/geos; 254 $text .= $fmt."\n"; 310 255 } 311 256 return $text; -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/MANIFEST
r2226 r2227 5 5 pub/System/ActionTrackerPlugin/atp_src.js 0660 Javascript source 6 6 pub/System/ActionTrackerPlugin/atp.js 0660 Javascript 7 pub/System/ActionTrackerPlugin/ juggle.gif0660 Image7 pub/System/ActionTrackerPlugin/logo.png 0660 Image 8 8 pub/System/ActionTrackerPlugin/wikiringlogo20x20.png 0660 9 9 tools/actionnotify 0555 Mailer script -
trunk/ActionTrackerPlugin/test/unit/ActionTrackerPlugin/ActionTests.pm
r2226 r2227 459 459 "", "| \$n\$n()\$nop()\$quot\$percnt\$dollar |", ""); 460 460 $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 461 $this->assert_html_matches("<td> <br /><br />\"%\$ </td>", $s );461 $this->assert_html_matches("<td> \n\n\"%\$ </td>", $s ); 462 462 463 463 Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002");
Note: See TracChangeset
for help on using the changeset viewer.
