Ignore:
Timestamp:
01/29/09 13:35:57 (3 years ago)
Author:
CrawfordCurrie
Message:

Item455: port to foswiki Item5974: correct CSS for search results table Item5938: load CSS for ACTIONSEARCH Item5606: Item5915: respect global settings for time format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ActionTrackerPlugin/test/unit/ActionTrackerPlugin/ActionTests.pm

    r1340 r2226  
    55use strict; 
    66 
    7 use TWiki::Plugins::ActionTrackerPlugin::Action; 
    8 use TWiki::Plugins::ActionTrackerPlugin::Format; 
     7use Foswiki::Plugins::ActionTrackerPlugin::Action; 
     8use Foswiki::Plugins::ActionTrackerPlugin::Format; 
    99use Time::ParseDate; 
    1010use CGI; 
     
    1717# Have to do this to force a read of the configuration 
    1818BEGIN { 
    19     new TWiki(); 
    20     $TWiki::cfg{Plugins}{ActionTrackerPlugin}{Enabled} = 1; 
     19    new Foswiki(); 
     20    $Foswiki::cfg{Plugins}{ActionTrackerPlugin}{Enabled} = 1; 
    2121}; 
    2222 
     
    2424    my $this = shift; 
    2525    $this->SUPER::set_up(); 
    26     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
     26 
     27    $Foswiki::cfg{DisplayTimeValues} = 'servertime'; 
     28    $Foswiki::cfg{DefaultDateFormat} = '$day $month $year'; 
     29    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
    2730} 
    2831 
     
    3033    my $this = shift; 
    3134    $this->SUPER::tear_down(); 
    32     TWiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
     35    Foswiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
    3336} 
    3437 
     
    3740 
    3841    # no state -> first state 
    39     my $action = new TWiki::Plugins::ActionTrackerPlugin::Action( 
     42    my $action = new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    4043        "Test","Topic",0,"", ""); 
    4144    $this->assert_str_equals("open", $action->{state}, $action->stringify()); 
    4245    # closed defined -> closed state 
    43     $action = new TWiki::Plugins::ActionTrackerPlugin::Action( 
     46    $action = new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    4447        "Test","Topic",0,"closed", ""); 
    4548    $this->assert_str_equals("closed", $action->{state}); 
    4649    $action = 
    47       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     50      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    4851          "Test","Topic",0,"closed=10-may-05", ""); 
    4952    $this->assert_str_equals("closed", $action->{state}); 
    5053    $action = 
    51       TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     54      Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    5255          "Test","Topic",0,"closer=Flicka", ""); 
    5356    $this->assert_str_equals("open", $action->{state}); 
    5457    # state def overrides closed defined 
    5558    $action = 
    56       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     59      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    5760          "Test","Topic",0,"",'closed,state="open"'); 
    5861    $this->assert_str_equals("open", $action->{state}); 
     
    6366 
    6467    my $action = 
    65       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     68      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    6669          "Test","Topic2",0, 
    6770          "web=Wrong,topic=Wrong web=Right", ""); 
     
    7477 
    7578    my $action = 
    76       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     79      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    7780          "Test","Topic",0, 
    7881          'who="Who" due="2 Jun 02" open', ""); 
    7982    $this->assert(!$action->isLate()); 
    8083    $this->assert_num_equals(2, $action->daysToGo()); 
    81     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
     84    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
    8285        "1 Jun 2002 23:59:59"); 
    8386    $this->assert(!$action->isLate()); 
    8487    $this->assert_num_equals(0, $action->daysToGo()); 
    85     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
     88    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
    8689        "2 Jun 2002 00:00:01"); 
    8790    $this->assert($action->isLate()); 
    8891    $this->assert_num_equals(-1, $action->daysToGo()); 
    89     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
     92    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
    9093        "3 Jun 2002 00:00:01"); 
    9194    $this->assert($action->isLate()); 
    9295    $this->assert_num_equals(-1, $action->daysToGo()); 
    93     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
     96    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime( 
    9497        "4 Jun 2002 00:00:01"); 
    9598    $this->assert($action->isLate()); 
    9699    $this->assert_num_equals(-2, $action->daysToGo()); 
    97100    $action = new 
    98       TWiki::Plugins::ActionTrackerPlugin::Action( 
     101      Foswiki::Plugins::ActionTrackerPlugin::Action( 
    99102          "Test","Topic",0, 
    100103          'who="Who" due="2 Jun 02" closed', ""); 
     
    106109 
    107110    my $action = 
    108       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     111      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    109112          "Test", "Topic", 0, 
    110113          'who="JohnDoe, SlyStallone",due="2 Jun 02",notify="SamPeckinpah, QuentinTarantino",creator="ThomasMoore"', 
     
    119122 
    120123    my $action = 
    121       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     124      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    122125          "Test", "Topic", 0, 
    123           'who="JohnDoe,SlyStallone,'.$TWiki::cfg{DefaultUserWikiName}.'" due="2 Jun 02" state=open notify="SamPeckinpah,QuentinTarantino" created="1999-01-01" creator="ThomasMoore"', 
     126          'who="JohnDoe,SlyStallone,'.$Foswiki::cfg{DefaultUserWikiName}.'" due="2 Jun 02" state=open notify="SamPeckinpah,QuentinTarantino" created="1999-01-01" creator="ThomasMoore"', 
    124127          "A new action"); 
    125128 
    126     my $attrs = new TWiki::Attrs("who=JohnDoe",1); 
     129    my $attrs = new Foswiki::Attrs("who=JohnDoe",1); 
    127130    $this->assert($action->matches($attrs),$attrs->stringify()); 
    128     $attrs = new TWiki::Attrs("who=$this->{users_web}.JohnDoe",1); 
    129     $this->assert($action->matches($attrs)); 
    130     $attrs = new TWiki::Attrs("who=me",1); 
    131     $this->assert($action->matches($attrs)); 
    132     $attrs = new TWiki::Attrs("who=JohnSmith",1); 
    133     $this->assert(!$action->matches($attrs)); 
    134     $attrs = new TWiki::Attrs("who=$this->{users_web}.SlyStallone",1); 
    135     $this->assert($action->matches($attrs)); 
    136     $attrs = new TWiki::Attrs("who",1); 
    137     $this->assert(!$action->matches($attrs)); 
    138  
    139     $attrs = new TWiki::Attrs('notify="SamPeckinpah"',1); 
    140     $this->assert($action->matches($attrs)); 
    141     $attrs = new TWiki::Attrs('notify="QuentinTarantino"',1); 
    142     $this->assert($action->matches($attrs)); 
    143     $attrs = new TWiki::Attrs('notify="JonasSalk,QuentinTarantino"',1); 
    144     $this->assert($action->matches($attrs)); 
    145     $attrs = new TWiki::Attrs('notify="SamBrowne,OscarWilde"',1); 
    146     $this->assert(!$action->matches($attrs)); 
    147     $attrs = new TWiki::Attrs("notify",1);  
    148     $this->assert(!$action->matches($attrs)); 
    149  
    150     $attrs = new TWiki::Attrs('state="open"',1); 
    151     $this->assert($action->matches($attrs)); 
    152     $attrs = new TWiki::Attrs("open",1); 
    153     $this->assert($action->matches($attrs)); 
    154     $attrs = new TWiki::Attrs("openday",1); 
    155     $this->assert(!$action->matches($attrs)); 
    156     $attrs = new TWiki::Attrs('state="(?!closed).*"',0); 
    157     $this->assert($action->matches($attrs)); 
    158  
    159     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("4 Jun 2002"); 
    160     $attrs = new TWiki::Attrs("within='+2'",1); 
    161     $this->assert(!$action->matches($attrs)); 
    162     $attrs = new TWiki::Attrs("within='2'",1); 
    163     $this->assert($action->matches($attrs)); 
    164     $attrs = new TWiki::Attrs("within='+1'",1); 
    165     $this->assert(!$action->matches($attrs)); 
    166     $attrs = new TWiki::Attrs("within='1'",1); 
    167     $this->assert(!$action->matches($attrs)); 
    168     $attrs = new TWiki::Attrs("within='-1'",1); 
    169     $this->assert(!$action->matches($attrs)); 
    170     $attrs = new TWiki::Attrs("within='-2'",1); 
    171     $this->assert($action->matches($attrs)); 
    172  
    173     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
    174     $attrs = new TWiki::Attrs("within='+2'",1); 
    175     $this->assert($action->matches($attrs)); 
    176     $attrs = new TWiki::Attrs("within='2'",1); 
    177     $this->assert($action->matches($attrs)); 
    178     $attrs = new TWiki::Attrs("within='+1'",1); 
    179     $this->assert(!$action->matches($attrs)); 
    180     $attrs = new TWiki::Attrs("within='1'",1); 
    181     $this->assert(!$action->matches($attrs)); 
    182     $attrs = new TWiki::Attrs("within='-2'",1); 
    183     $this->assert(!$action->matches($attrs)); 
    184  
    185     $attrs = new TWiki::Attrs("late",1); 
    186     $this->assert(!$action->matches($attrs)); 
    187  
    188     $attrs = new TWiki::Attrs("web=Test",1); 
    189     $this->assert($action->matches($attrs)); 
    190     $attrs = new TWiki::Attrs('web=".*t"',1); 
    191     $this->assert($action->matches($attrs)); 
    192     $attrs = new TWiki::Attrs('web="A.*"',1); 
    193     $this->assert(!$action->matches($attrs)); 
    194  
    195     $attrs = new TWiki::Attrs("topic=Topic",1); 
    196     $this->assert($action->matches($attrs)); 
    197     $attrs = new TWiki::Attrs('topic=".*c"',1); 
    198     $this->assert($action->matches($attrs)); 
    199     $attrs = new TWiki::Attrs('topic="A.*"',1); 
    200     $this->assert(!$action->matches($attrs)); 
    201  
    202     $attrs = new TWiki::Attrs('due="2 Jun 02"',1); 
    203     $this->assert($action->matches($attrs)); 
    204     $attrs = new TWiki::Attrs('due="3 Jun 02"',1); 
    205     $this->assert(!$action->matches($attrs)); 
    206     $attrs = new TWiki::Attrs('due="< 3 Jun 02"',1); 
    207     $this->assert($action->matches($attrs)); 
    208     $attrs = new TWiki::Attrs('due="> 3 Jun 02"',1); 
    209     $this->assert(!$action->matches($attrs)); 
    210     $attrs = new TWiki::Attrs('due="> 1 Jun 02"',1); 
    211     $this->assert($action->matches($attrs)); 
    212     $attrs = new TWiki::Attrs('due="< 1 Jun 02"',1); 
    213     $this->assert(!$action->matches($attrs)); 
    214  
    215     $attrs = new TWiki::Attrs("creator=ThomasMoore",1); 
    216     $this->assert($action->matches($attrs)); 
    217     $attrs = new TWiki::Attrs("creator=QuentinTarantino",1); 
    218     $this->assert(!$action->matches($attrs)); 
    219  
    220     $attrs = new TWiki::Attrs('created="1999-01-01"',1); 
    221     $this->assert($action->matches($attrs)); 
    222     $attrs = new TWiki::Attrs('created="2 Jun 02"',1); 
    223     $this->assert(!$action->matches($attrs)); 
    224     $attrs = new TWiki::Attrs('created="2 Jan 1999"',1); 
    225     $this->assert(!$action->matches($attrs)); 
    226     $attrs = new TWiki::Attrs('created="< 2 Jan 1999"',1); 
    227     $this->assert($action->matches($attrs)); 
    228     $attrs = new TWiki::Attrs('created="> 2 Jan 1999"',1); 
    229     $this->assert(!$action->matches($attrs)); 
    230     $attrs = new TWiki::Attrs('created=">= 1 Jan 1999"',1); 
    231     $this->assert($action->matches($attrs)); 
    232     $attrs = new TWiki::Attrs('created="< 1 Jan 1999"',1); 
    233     $this->assert(!$action->matches($attrs)); 
    234  
    235     $attrs = new TWiki::Attrs("closed",1); 
    236     $this->assert(!$action->matches($attrs)); 
    237     $attrs = new TWiki::Attrs('closed="2 Jun 02"',1); 
    238     $this->assert(!$action->matches($attrs)); 
    239     $attrs = new TWiki::Attrs('closed="1 Jan 1999"',1); 
     131    $attrs = new Foswiki::Attrs("who=$this->{users_web}.JohnDoe",1); 
     132    $this->assert($action->matches($attrs)); 
     133    $attrs = new Foswiki::Attrs("who=me",1); 
     134    $this->assert($action->matches($attrs)); 
     135    $attrs = new Foswiki::Attrs("who=JohnSmith",1); 
     136    $this->assert(!$action->matches($attrs)); 
     137    $attrs = new Foswiki::Attrs("who=$this->{users_web}.SlyStallone",1); 
     138    $this->assert($action->matches($attrs)); 
     139    $attrs = new Foswiki::Attrs("who",1); 
     140    $this->assert(!$action->matches($attrs)); 
     141 
     142    $attrs = new Foswiki::Attrs('notify="SamPeckinpah"',1); 
     143    $this->assert($action->matches($attrs)); 
     144    $attrs = new Foswiki::Attrs('notify="QuentinTarantino"',1); 
     145    $this->assert($action->matches($attrs)); 
     146    $attrs = new Foswiki::Attrs('notify="JonasSalk,QuentinTarantino"',1); 
     147    $this->assert($action->matches($attrs)); 
     148    $attrs = new Foswiki::Attrs('notify="SamBrowne,OscarWilde"',1); 
     149    $this->assert(!$action->matches($attrs)); 
     150    $attrs = new Foswiki::Attrs("notify",1);  
     151    $this->assert(!$action->matches($attrs)); 
     152 
     153    $attrs = new Foswiki::Attrs('state="open"',1); 
     154    $this->assert($action->matches($attrs)); 
     155    $attrs = new Foswiki::Attrs("open",1); 
     156    $this->assert($action->matches($attrs)); 
     157    $attrs = new Foswiki::Attrs("openday",1); 
     158    $this->assert(!$action->matches($attrs)); 
     159    $attrs = new Foswiki::Attrs('state="(?!closed).*"',0); 
     160    $this->assert($action->matches($attrs)); 
     161 
     162    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("4 Jun 2002"); 
     163    $attrs = new Foswiki::Attrs("within='+2'",1); 
     164    $this->assert(!$action->matches($attrs)); 
     165    $attrs = new Foswiki::Attrs("within='2'",1); 
     166    $this->assert($action->matches($attrs)); 
     167    $attrs = new Foswiki::Attrs("within='+1'",1); 
     168    $this->assert(!$action->matches($attrs)); 
     169    $attrs = new Foswiki::Attrs("within='1'",1); 
     170    $this->assert(!$action->matches($attrs)); 
     171    $attrs = new Foswiki::Attrs("within='-1'",1); 
     172    $this->assert(!$action->matches($attrs)); 
     173    $attrs = new Foswiki::Attrs("within='-2'",1); 
     174    $this->assert($action->matches($attrs)); 
     175 
     176    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
     177    $attrs = new Foswiki::Attrs("within='+2'",1); 
     178    $this->assert($action->matches($attrs)); 
     179    $attrs = new Foswiki::Attrs("within='2'",1); 
     180    $this->assert($action->matches($attrs)); 
     181    $attrs = new Foswiki::Attrs("within='+1'",1); 
     182    $this->assert(!$action->matches($attrs)); 
     183    $attrs = new Foswiki::Attrs("within='1'",1); 
     184    $this->assert(!$action->matches($attrs)); 
     185    $attrs = new Foswiki::Attrs("within='-2'",1); 
     186    $this->assert(!$action->matches($attrs)); 
     187 
     188    $attrs = new Foswiki::Attrs("late",1); 
     189    $this->assert(!$action->matches($attrs)); 
     190 
     191    $attrs = new Foswiki::Attrs("web=Test",1); 
     192    $this->assert($action->matches($attrs)); 
     193    $attrs = new Foswiki::Attrs('web=".*t"',1); 
     194    $this->assert($action->matches($attrs)); 
     195    $attrs = new Foswiki::Attrs('web="A.*"',1); 
     196    $this->assert(!$action->matches($attrs)); 
     197 
     198    $attrs = new Foswiki::Attrs("topic=Topic",1); 
     199    $this->assert($action->matches($attrs)); 
     200    $attrs = new Foswiki::Attrs('topic=".*c"',1); 
     201    $this->assert($action->matches($attrs)); 
     202    $attrs = new Foswiki::Attrs('topic="A.*"',1); 
     203    $this->assert(!$action->matches($attrs)); 
     204 
     205    $attrs = new Foswiki::Attrs('due="2 Jun 02"',1); 
     206    $this->assert($action->matches($attrs)); 
     207    $attrs = new Foswiki::Attrs('due="3 Jun 02"',1); 
     208    $this->assert(!$action->matches($attrs)); 
     209    $attrs = new Foswiki::Attrs('due="< 3 Jun 02"',1); 
     210    $this->assert($action->matches($attrs)); 
     211    $attrs = new Foswiki::Attrs('due="> 3 Jun 02"',1); 
     212    $this->assert(!$action->matches($attrs)); 
     213    $attrs = new Foswiki::Attrs('due="> 1 Jun 02"',1); 
     214    $this->assert($action->matches($attrs)); 
     215    $attrs = new Foswiki::Attrs('due="< 1 Jun 02"',1); 
     216    $this->assert(!$action->matches($attrs)); 
     217 
     218    $attrs = new Foswiki::Attrs("creator=ThomasMoore",1); 
     219    $this->assert($action->matches($attrs)); 
     220    $attrs = new Foswiki::Attrs("creator=QuentinTarantino",1); 
     221    $this->assert(!$action->matches($attrs)); 
     222 
     223    $attrs = new Foswiki::Attrs('created="1999-01-01"',1); 
     224    $this->assert($action->matches($attrs)); 
     225    $attrs = new Foswiki::Attrs('created="2 Jun 02"',1); 
     226    $this->assert(!$action->matches($attrs)); 
     227    $attrs = new Foswiki::Attrs('created="2 Jan 1999"',1); 
     228    $this->assert(!$action->matches($attrs)); 
     229    $attrs = new Foswiki::Attrs('created="< 2 Jan 1999"',1); 
     230    $this->assert($action->matches($attrs)); 
     231    $attrs = new Foswiki::Attrs('created="> 2 Jan 1999"',1); 
     232    $this->assert(!$action->matches($attrs)); 
     233    $attrs = new Foswiki::Attrs('created=">= 1 Jan 1999"',1); 
     234    $this->assert($action->matches($attrs)); 
     235    $attrs = new Foswiki::Attrs('created="< 1 Jan 1999"',1); 
     236    $this->assert(!$action->matches($attrs)); 
     237 
     238    $attrs = new Foswiki::Attrs("closed",1); 
     239    $this->assert(!$action->matches($attrs)); 
     240    $attrs = new Foswiki::Attrs('closed="2 Jun 02"',1); 
     241    $this->assert(!$action->matches($attrs)); 
     242    $attrs = new Foswiki::Attrs('closed="1 Jan 1999"',1); 
    240243    $this->assert(!$action->matches($attrs)); 
    241244 
    242245    # make it late 
    243     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
    244     $attrs = new TWiki::Attrs("late",1); 
    245     $this->assert($action->matches($attrs)); 
    246  
    247     $attrs = new TWiki::Attrs("within=-1",1); 
     246    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
     247    $attrs = new Foswiki::Attrs("late",1); 
     248    $this->assert($action->matches($attrs)); 
     249 
     250    $attrs = new Foswiki::Attrs("within=-1",1); 
    248251    $this->assert($action->matches($attrs), $action->secsToGo()); 
    249     $attrs = new TWiki::Attrs("within=+1",1); 
     252    $attrs = new Foswiki::Attrs("within=+1",1); 
    250253    $this->assert(!$action->matches($attrs), $action->secsToGo()); 
    251254} 
     
    254257    my $this = shift; 
    255258 
    256     my $action = new TWiki::Plugins::ActionTrackerPlugin::Action( 
     259    my $action = new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    257260        "Test", "Topic", 0, 
    258261        'who="JohnDoe,SlyStallone",due="2 Jun 02" closed="2 Dec 00" closer="Death" notify="SamPeckinpah,QuentinTarantino" created="1 Jan 1999" creator="ThomasMoore"', 
    259262        "A new action"); 
    260     my $attrs = new TWiki::Attrs("closed",1,1); 
     263    my $attrs = new Foswiki::Attrs("closed",1,1); 
    261264    $this->assert($action->matches($attrs), $action->stringify()); 
    262     $attrs = new TWiki::Attrs('closed="2 Dec 00"',1); 
    263     $this->assert($action->matches($attrs)); 
    264     $attrs = new TWiki::Attrs('closed="> 1 Dec 00"',1); 
    265     $this->assert($action->matches($attrs)); 
    266     $attrs = new TWiki::Attrs('closed="< 1 Dec 00"',1); 
    267     $this->assert(!$action->matches($attrs)); 
    268     $attrs = new TWiki::Attrs('closed="2 Dec 01"',1); 
    269     $this->assert(!$action->matches($attrs)); 
    270  
    271     $attrs = new TWiki::Attrs("closer=Death",1,1); 
    272     $this->assert($action->matches($attrs)); 
    273     $attrs = new TWiki::Attrs("open",1); 
     265    $attrs = new Foswiki::Attrs('closed="2 Dec 00"',1); 
     266    $this->assert($action->matches($attrs)); 
     267    $attrs = new Foswiki::Attrs('closed="> 1 Dec 00"',1); 
     268    $this->assert($action->matches($attrs)); 
     269    $attrs = new Foswiki::Attrs('closed="< 1 Dec 00"',1); 
     270    $this->assert(!$action->matches($attrs)); 
     271    $attrs = new Foswiki::Attrs('closed="2 Dec 01"',1); 
     272    $this->assert(!$action->matches($attrs)); 
     273 
     274    $attrs = new Foswiki::Attrs("closer=Death",1,1); 
     275    $this->assert($action->matches($attrs)); 
     276    $attrs = new Foswiki::Attrs("open",1); 
    274277    $this->assert(!$action->matches($attrs)); 
    275278} 
     
    278281    my $this = shift; 
    279282 
    280     my $action = new TWiki::Plugins::ActionTrackerPlugin::Action( 
     283    my $action = new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    281284        "Test", "Topic", 0, 
    282285        'who="JohnDoe" due="2 Jun 02" state=open notify="SamPeckinpah,QuentinTarantino" created="1 Jan 1999" creator="ThomasMoore"', 
    283286        "A new action"); 
    284     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     287    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    285288        "|Who|Due|","|\$who|","","Who: \$who \$who","\$who,\$due"); 
    286289    my $s = $fmt->formatStringTable([$action]); 
    287290    $this->assert_str_equals("Who: $this->{users_web}.JohnDoe $this->{users_web}.JohnDoe\n",$s, 
    288291                             $fmt->stringify()); 
    289     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     292    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    290293        "","","","Due: \$due"); 
    291294    # make it late 
    292     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
    293     $s = $fmt->formatStringTable([$action]); 
    294     $this->assert_str_equals("Due: Sun, 02 Jun 2002 (LATE)\n", $s); 
     295    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
     296    $s = $fmt->formatStringTable([$action]); 
     297    $this->assert_str_equals("Due: 02 Jun 2002 (LATE)\n", $s); 
    295298    # make it ontime 
    296     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002"); 
    297     $s = $fmt->formatStringTable([$action]); 
    298     $this->assert_str_equals("Due: Sun, 02 Jun 2002\n", $s); 
     299    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002"); 
     300    $s = $fmt->formatStringTable([$action]); 
     301    $this->assert_str_equals("Due: 02 Jun 2002\n", $s); 
    299302    # make it late again 
    300     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
    301     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     303    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
     304    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    302305        "","","", "State: \$state\n"); 
    303306    $s = $fmt->formatStringTable([$action]); 
    304307    $this->assert_str_equals("State: open\n\n", $s); 
    305     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     308    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    306309        "","", "","Notify: \$notify\n"); 
    307310    $s = $fmt->formatStringTable([$action]); 
    308311    $this->assert_str_equals( 
    309312        "Notify: $this->{users_web}.SamPeckinpah, $this->{users_web}.QuentinTarantino\n\n", $s); 
    310     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     313    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    311314        "","", "", "\$creator"); 
    312315    $s = $fmt->formatStringTable([$action]); 
    313316    $this->assert_str_equals($s, "$this->{users_web}.ThomasMoore\n"); 
    314     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     317    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    315318        "","", "","|\$created|"); 
    316319    $s = $fmt->formatStringTable([$action]); 
    317     $this->assert_str_equals("|Fri, 01 Jan 1999|\n", $s); 
    318     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     320    $this->assert_str_equals("|01 Jan 1999|\n", $s); 
     321    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    319322        "","", "","|\$edit|"); 
    320323    $s = $fmt->formatStringTable([$action]); 
    321324    $this->assert_str_equals("||\n", $s); 
    322     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     325    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    323326        "","", "","\$web.\$topic"); 
    324327    $s = $fmt->formatStringTable([$action]); 
    325328    $this->assert_str_equals("Test.Topic\n", $s); 
    326     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     329    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    327330        "","", "", 'Text "$text"'); 
    328331    $s = $fmt->formatStringTable([$action]); 
    329332    $this->assert_str_equals("Text \"A new action\"\n", $s); 
    330     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     333    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    331334        "","", "","|\$n\$n()\$nop()\$quot\$percnt\$dollar|"); 
    332335    $s = $fmt->formatStringTable([$action]); 
    333336    $this->assert_str_equals("|\n\n\"%\$|\n", $s); 
    334     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     337    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    335338        "","","","Who: \$who Creator: \$creator"); 
    336339    $s = $fmt->formatStringTable([$action]); 
     
    342345    my $this = shift; 
    343346 
    344     my $action = new TWiki::Plugins::ActionTrackerPlugin::Action( 
     347    my $action = new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    345348        "Test","Topic", 0, 
    346349        'who=JohnDoe due="2 Jun 02" closed="1-Jan-03" closer="LucBesson"', 
    347350        "A new action"); 
    348     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     351    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    349352        "","", "", "|\$closed|\$closer|"); 
    350353    my $s = $fmt->formatStringTable([$action]); 
    351354    $this->assert_str_equals( 
    352         $s, "|Wed, 01 Jan 2003|$this->{users_web}.LucBesson|\n"); 
     355        $s, "|01 Jan 2003|$this->{users_web}.LucBesson|\n"); 
    353356} 
    354357 
     
    356359    my $this = shift; 
    357360 
    358     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
    359     my $action = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     361    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
     362    my $action = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    360363        "Test", "Topic", 0, 
    361364        'who=JohnDoe due="2 Jun 02" state=open notify="SamPeckinpah,QuentinTarantino" created="1 Jan 1999" creator="ThomasMoore"', 
    362365        "A new action"); 
    363     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     366    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    364367        "|Who|Due|", "|\$who|\$due|", "rows"); 
    365368    my $s = $fmt->formatHTMLTable([$action], "name", 0, 'atp'); 
    366     $s =~ s/<table class=\"atp\">//; 
     369    $s =~ s/<table class=\"atpSearch\">//; 
    367370    $s =~ s/<\/table>//; 
    368371    $s =~ s/\n//g; 
    369     $this->assert_str_equals("<tr><th>Who</th><td><a name=\"AcTion0\" />$this->{users_web}.JohnDoe</td></tr><tr><th>Due</th><td><span class=\"atpOpen\">Sun, 02 Jun 2002</span></td></tr>", $s); 
     372    $this->assert_str_equals("<tr><th align=\"right\">Who</th><td><a name=\"AcTion0\" />$this->{users_web}.JohnDoe</td></tr><tr><th align=\"right\">Due</th><td><span class=\"atpOpen\">02 Jun 2002</span></td></tr>", $s); 
    370373} 
    371374 
     
    373376    my $this = shift; 
    374377 
    375     my $action = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     378    my $action = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    376379        "Test", "Topic", 0, 
    377380        'who=JohnDoe due="2 Jun 02" state=open notify="SamPeckinpah,QuentinTarantino, DavidLynch" created="1 Jan 1999" creator="ThomasMoore"', 
    378381        "A new action"); 
    379382 
    380     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format("", "|\$who|"); 
     383    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format("", "|\$who|"); 
    381384    my $s = $fmt->formatHTMLTable([$action], "name", 0, 'atp'); 
    382385    $this->assert_html_matches( 
    383386        "<td><a name=\"AcTion0\" />$this->{users_web}.JohnDoe</td>", $s); 
    384     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format("", "| \$due |"); 
     387    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format("", "| \$due |"); 
    385388    # make it late 
    386     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
    387     $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    388     $this->assert_html_matches( 
    389         "<td> <span class=\"atpWarn\">Sun, 02 Jun 2002</span> </td>", $s); 
     389    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
     390    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
     391    $this->assert_html_matches( 
     392        "<td> <span class=\"atpWarn\">02 Jun 2002</span> </td>", $s); 
    390393 
    391394    # make it ontime 
    392     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002"); 
    393     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     395    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002"); 
     396    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    394397        "", "| \$due |", ""); 
    395398    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    396399    $this->assert_html_matches( 
    397         "<td> <span class=\"atpOpen\">Sun, 02 Jun 2002</span>  </td>", $s); 
     400        "<td> <span class=\"atpOpen\">02 Jun 2002</span>  </td>", $s); 
    398401 
    399402    # Make it late again 
    400     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
    401     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     403    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("3 Jun 2002"); 
     404    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    402405        "", "| \$state |", ""); 
    403406    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    404407    $this->assert_html_matches("<td> open </td>", $s ); 
    405408 
    406     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format("", "| \$notify |"); 
     409    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format("", "| \$notify |"); 
    407410    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    408411    $this->assert_html_matches( 
     
    410413        $s ); 
    411414 
    412     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format("", "| \$uid |"); 
     415    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format("", "| \$uid |"); 
    413416    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    414417    $this->assert_html_matches("<td> &nbsp; </td>", $s ); 
    415418 
    416     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     419    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    417420        "", "| \$creator |", ""); 
    418421    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    419422    $this->assert_html_matches("<td> $this->{users_web}.ThomasMoore </td>", $s ); 
    420423 
    421     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     424    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    422425        "", "| \$created |", ""); 
    423426    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    424     $this->assert_html_matches("<td> Fri, 01 Jan 1999 </td>", $s ); 
    425  
    426     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     427    $this->assert_html_matches("<td> 01 Jan 1999 </td>", $s ); 
     428 
     429    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    427430        "", "| \$edit |", ""); 
    428     my $url = "$TWiki::cfg{DefaultUrlHost}$TWiki::cfg{ScriptUrlPath}/edit$TWiki::cfg{ScriptSuffix}/Test/Topic\\?skin=action%2cpattern;atp_action=AcTion0;t="; 
     431    my $url = "$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}/edit$Foswiki::cfg{ScriptSuffix}/Test/Topic\\?skin=action%2cpattern;atp_action=AcTion0;t="; 
    429432    $s = $fmt->formatHTMLTable([$action], "href", 0 ); 
    430433    $this->assert($s =~ m(<td> <a href="(.*?)">edit</a> </td>), $s); 
     
    432435    $this->assert_matches(qr(^$url\d+$), $1); 
    433436 
    434     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     437    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    435438        "", "| \$edit |", ""); 
    436439    $s = $fmt->formatHTMLTable([$action], "href", 1, 'atp'); 
     
    441444    $this->assert_matches(qr/onclick="return atp_editWindow\('$url\d+'\)"/, $x); 
    442445 
    443     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     446    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    444447        "", "| \$web.\$topic |", ""); 
    445448    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
     
    447450    $this->assert_html_matches('<td> Test.Topic </td>', $s ); 
    448451 
    449     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     452    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    450453        "", "| \$text |", ""); 
    451454    $s = $fmt->formatHTMLTable([$action], "href", 0, 'XXX'); 
    452     $this->assert( $s =~ /<td> A new action <a href="$TWiki::cfg{DefaultUrlHost}$TWiki::cfg{ScriptUrlPath}\/view$TWiki::cfg{ScriptSuffix}\/Test\/Topic#AcTion0">/, 
     455    $this->assert( $s =~ /<td> A new action <a href="$Foswiki::cfg{DefaultUrlHost}$Foswiki::cfg{ScriptUrlPath}\/view$Foswiki::cfg{ScriptSuffix}\/Test\/Topic#AcTion0">/, 
    453456        $s ); 
    454457 
    455     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     458    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    456459        "", "| \$n\$n()\$nop()\$quot\$percnt\$dollar |", ""); 
    457460    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    458461    $this->assert_html_matches("<td> <br /><br />\"%\$ </td>", $s ); 
    459462 
    460     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002"); 
    461     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     463    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("1 Jun 2002"); 
     464    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    462465        "", "| \$due |", ""); 
    463466    $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    464467    $this->assert_html_matches( 
    465         "<td> <span class=\"atpOpen\">Sun, 02 Jun 2002</span> </td>", $s ); 
    466  
    467     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     468        "<td> <span class=\"atpOpen\">02 Jun 2002</span> </td>", $s ); 
     469 
     470    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    468471        "", "|\$who|\$creator|", ""); 
    469472    $s = $fmt->formatHTMLTable([$action], "name", 0, 'atp'); 
     
    476479    my $this = shift; 
    477480 
    478     my $action = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     481    my $action = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    479482        "Test", "Topic", 0, 
    480483        'who=JohnDoe due="2 Jun 02" closed="1-Jan-03" closer="LucBesson"', 
    481484        "A new action"); 
    482     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     485    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    483486        "", "|\$closed|\$closer|", ""); 
    484487    my $s = $fmt->formatHTMLTable([$action], "href", 0, 'atp'); 
    485488    $this->assert_html_matches( 
    486         "<td>Wed, 01 Jan 2003</td><td>$this->{users_web}.LucBesson</td>", $s ); 
     489        "<td>01 Jan 2003</td><td>$this->{users_web}.LucBesson</td>", $s ); 
    487490} 
    488491 
     
    490493    my $this = shift; 
    491494 
    492     my $action = new TWiki::Plugins::ActionTrackerPlugin::Action( 
     495    my $action = new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    493496          "Test", "Topic", 7, 
    494497          "state=closed", "A new action"); 
    495     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
     498    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
    496499    my $tim = Time::ParseDate::parsedate("31 May 2002"); 
    497500    $action->populateMissingFields(); 
    498     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     501    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    499502        "","","","|\$uid|\$who|"); 
    500503    my $s = $fmt->formatStringTable([$action]); 
    501     $this->assert_matches(qr/^\|\d\d\d\d\d\d\|$this->{users_web}\.$TWiki::cfg{DefaultUserWikiName}\|\n/, $s); 
    502     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     504    $this->assert_matches(qr/^\|\d\d\d\d\d\d\|$this->{users_web}\.$Foswiki::cfg{DefaultUserWikiName}\|\n/, $s); 
     505    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    503506        "","","","|\$creator|\$created|"); 
    504507    $s = $fmt->formatStringTable([$action]); 
    505     $this->assert_str_equals("|$this->{users_web}.$TWiki::cfg{DefaultUserWikiName}|Fri, 31 May 2002|\n", $s); 
    506     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     508    $this->assert_str_equals("|$this->{users_web}.$Foswiki::cfg{DefaultUserWikiName}|31 May 2002|\n", $s); 
     509    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    507510        "","","","|\$closer|\$closed|"); 
    508511    $s = $fmt->formatStringTable([$action]); 
    509     $this->assert_str_equals("|$this->{users_web}.$TWiki::cfg{DefaultUserWikiName}|Fri, 31 May 2002|\n", $s); 
     512    $this->assert_str_equals("|$this->{users_web}.$Foswiki::cfg{DefaultUserWikiName}|31 May 2002|\n", $s); 
    510513    $action = 
    511       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     514      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    512515          "Test", "Topic", 8, 
    513516          "who=me", "action"); 
    514517    $action->populateMissingFields(); 
    515     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     518    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    516519        "","","","|\$who|\$created|"); 
    517520    $s = $fmt->formatStringTable([$action]); 
    518     $this->assert_str_equals("|$this->{users_web}.$TWiki::cfg{DefaultUserWikiName}|Fri, 31 May 2002|\n", $s); 
     521    $this->assert_str_equals("|$this->{users_web}.$Foswiki::cfg{DefaultUserWikiName}|31 May 2002|\n", $s); 
    519522} 
    520523 
     
    522525    my $this = shift; 
    523526 
    524     my $action = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     527    my $action = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    525528        "Test", "Topic", 5, "due=\"2 Jun 02\" state=closed", "A new action"); 
    526     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("30 Sep 2001"); 
     529    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("30 Sep 2001"); 
    527530    $action->populateMissingFields(); 
    528531    my $s = $action->stringify(); 
    529532    $s =~ s/ uid="\d+"//o; 
    530533    $s =~ s/ created="2001-09-30"//o; 
    531     $s =~ s/ creator="$this->{users_web}\.$TWiki::cfg{DefaultUserWikiName}"//o; 
    532     $s =~ s/ who="$this->{users_web}\.$TWiki::cfg{DefaultUserWikiName}"//o; 
     534    $s =~ s/ creator="$this->{users_web}\.$Foswiki::cfg{DefaultUserWikiName}"//o; 
     535    $s =~ s/ who="$this->{users_web}\.$Foswiki::cfg{DefaultUserWikiName}"//o; 
    533536    $s =~ s/ due="2002-06-02"//o; 
    534537    $s =~ s/ closed="2001-09-30"//o; 
    535     $s =~ s/ closer="$this->{users_web}\.$TWiki::cfg{DefaultUserWikiName}"//o; 
     538    $s =~ s/ closer="$this->{users_web}\.$Foswiki::cfg{DefaultUserWikiName}"//o; 
    536539    $s =~ s/ state="closed"//o; 
    537540    $this->assert_str_equals("%ACTION{ }% A new action %ENDACTION%", $s); 
    538541 
    539     $action = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     542    $action = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    540543        "Test", "Topic", 9, 
    541544        "due=\"2 Jun 06\" state=open", 
     
    556559AFour 
    557560EOF"; 
    558     use TWiki::Plugins::ActionTrackerPlugin::ActionSet; 
    559     my $as = TWiki::Plugins::ActionTrackerPlugin::ActionSet::load( 
     561    use Foswiki::Plugins::ActionTrackerPlugin::ActionSet; 
     562    my $as = Foswiki::Plugins::ActionTrackerPlugin::ActionSet::load( 
    560563        "Test", "Topic", $text, 1); 
    561564 
     
    601604    my $this = shift; 
    602605 
    603     my $oaction = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     606    my $oaction = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    604607        "Test", "Topic", 0, 
    605608        "who=JohnDoe due=\"2 Jun 02\" state=open notify=\"SamPeckinpah,QuentinTarantino\" created=\"1 Jan 1999\"", 
    606609        "A new action"); 
    607610 
    608     my $naction = TWiki::Plugins::ActionTrackerPlugin::Action->new( "Test", "Topic", 0, "who=JaneDoe due=\"2 Jun 09\" state=closed notify=\"SamPeckinpah,QuentinTarantino\" creator=\"ThomasMoore\"", "A new action<p>with more text"); 
     611    my $naction = Foswiki::Plugins::ActionTrackerPlugin::Action->new( "Test", "Topic", 0, "who=JaneDoe due=\"2 Jun 09\" state=closed notify=\"SamPeckinpah,QuentinTarantino\" creator=\"ThomasMoore\"", "A new action<p>with more text"); 
    609612 
    610613    my $s = "|\$who|\$due|\$state|\$creator|\$created|\$text|"; 
    611     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     614    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    612615        $s,$s,"cols",$s,"\$who,\$due,\$state,\$created,\$creator,\$text"); 
    613616    my %not = (); 
     
    615618    my $text = $not{"$this->{users_web}.SamPeckinpah"}{text}; 
    616619    $this->assert_matches( 
    617         qr/\|$this->{users_web}.JaneDoe\|Tue, 2 Jun 2009\|closed\|$this->{users_web}.ThomasMoore\|/, 
     620        qr/\|$this->{users_web}.JaneDoe\|2 Jun 2009\|closed\|$this->{users_web}.ThomasMoore\|/, 
    618621        $text); 
    619622    $this->assert_matches(qr/\|A new action<p>with more text\|/, $text); 
     
    621624        qr/Attribute \"state\" changed, was \"open\", now \"closed\"/, $text); 
    622625    $this->assert_matches( 
    623         qr/Attribute \"due\" changed, was \"Sun, 2 Jun 2002\", now \"Tue, 2 Jun 2009\"/, 
     626        qr/Attribute \"due\" changed, was \"2 Jun 2002\", now \"2 Jun 2009\"/, 
    624627        $text); 
    625628    $this->assert_matches( 
     
    627630        $text); 
    628631    $this->assert_matches( 
    629         qr/Attribute \"created\" was \"Fri, 1 Jan 1999\" now removed/, 
     632        qr/Attribute \"created\" was \"1 Jan 1999\" now removed/, 
    630633        $text); 
    631634    $this->assert_matches( 
     
    640643        $text); 
    641644    $this->assert_html_matches( 
    642         "<tr class=\"atpChanges\"><td class=\"atpChanges\">due</td><td class=\"atpChanges\"><span class=\"atpOpen\">Sun, 02 Jun 2002</span></td><td class=\"atpChanges\"><span class=\"atpClosed\">Tue, 02 Jun 2009</span></td></tr>", 
     645        "<tr class=\"atpChanges\"><td class=\"atpChanges\">due</td><td class=\"atpChanges\"><span class=\"atpOpen\">02 Jun 2002</span></td><td class=\"atpChanges\"><span class=\"atpClosed\">02 Jun 2009</span></td></tr>", 
    643646        $text); 
    644647    $this->assert_html_matches( 
     
    646649        $text); 
    647650    $this->assert_html_matches( 
    648         "<tr class=\"atpChanges\"><td class=\"atpChanges\">created</td><td class=\"atpChanges\">Fri, 01 Jan 1999</td><td class=\"atpChanges\"> *removed* </td></tr>", 
     651        "<tr class=\"atpChanges\"><td class=\"atpChanges\">created</td><td class=\"atpChanges\">01 Jan 1999</td><td class=\"atpChanges\"> *removed* </td></tr>", 
    649652        $text); 
    650653    $this->assert_html_matches( 
     
    659662    my $this = shift; 
    660663 
    661     my $s = TWiki::Plugins::ActionTrackerPlugin::Action::extendTypes( 
     664    my $s = Foswiki::Plugins::ActionTrackerPlugin::Action::extendTypes( 
    662665        "| plaintiffs,names,16| decision, text, 16|sentencing,date|sentence,select,17,life,\"5 years\",\"community service\"|"); 
    663666    $this->assert(!defined($s), $s); 
    664667 
    665     my $action = TWiki::Plugins::ActionTrackerPlugin::Action->new( 
     668    my $action = Foswiki::Plugins::ActionTrackerPlugin::Action->new( 
    666669        "Test", "Topic", 0, 
    667670        'who=JohnDoe due="2002-06-02" state=open,plaintiffs="fred.bloggs@limp.net,JoeShmoe",decision="cut off their heads" sentencing=2-mar-2006 sentence="5 years"', 
     
    675678    $s =~ s/ plaintiffs="fred.bloggs\@limp.net, $this->{users_web}.JoeShmoe"//o; 
    676679    $s =~ s/ decision="cut off their heads"//o; 
    677     $s =~ s/ who="$this->{users_web}\.$TWiki::cfg{DefaultUserWikiName}"//o; 
     680    $s =~ s/ who="$this->{users_web}\.$Foswiki::cfg{DefaultUserWikiName}"//o; 
    678681    $s =~ s/ sentencing="2006-03-02"//o; 
    679682    $s =~ s/ sentence="5 years"//o; 
    680683    $this->assert_str_equals("%ACTION{ }% %ENDACTION%", $s); 
    681684 
    682     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     685    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    683686        "", "|\$plaintiffs|","","\$plaintiffs"); 
    684687    $s = $fmt->formatStringTable([$action]); 
     
    688691        qr/<td>fred.bloggs\@limp.net, $this->{users_web}.JoeShmoe<\/td>/, $s ); 
    689692 
    690     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     693    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    691694        "", "|\$decision|","","\$decision"); 
    692695    $s = $fmt->formatStringTable([$action]); 
     
    695698    $this->assert_matches(qr/<td>cut off their heads<\/td>/, $s ); 
    696699 
    697     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     700    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    698701        "", "|\$sentence|","","\$sentence"); 
    699702    $s = $fmt->formatStringTable([$action]); 
     
    702705    $this->assert_matches(qr/<td>5 years<\/td>/, $s ); 
    703706 
    704     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     707    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    705708        "", "","","\$sentencing"); 
    706709    $s = $fmt->formatStringTable([$action]); 
    707     $this->assert_str_equals("Thu, 02 Mar 2006\n", $s); 
    708  
    709     my $attrs = TWiki::Attrs->new("sentence=\"5 years\""); 
    710     $this->assert($action->matches($attrs)); 
    711     $attrs = TWiki::Attrs->new("sentence=\"life\""); 
    712     $this->assert(!$action->matches($attrs)); 
    713     $attrs = TWiki::Attrs->new("sentence=\"\\d+ years\""); 
    714     $this->assert($action->matches($attrs)); 
    715  
    716     $s = TWiki::Plugins::ActionTrackerPlugin::Action::extendTypes( 
     710    $this->assert_str_equals("02 Mar 2006\n", $s); 
     711 
     712    my $attrs = Foswiki::Attrs->new("sentence=\"5 years\""); 
     713    $this->assert($action->matches($attrs)); 
     714    $attrs = Foswiki::Attrs->new("sentence=\"life\""); 
     715    $this->assert(!$action->matches($attrs)); 
     716    $attrs = Foswiki::Attrs->new("sentence=\"\\d+ years\""); 
     717    $this->assert($action->matches($attrs)); 
     718 
     719    $s = Foswiki::Plugins::ActionTrackerPlugin::Action::extendTypes( 
    717720        "|state,select,17,life,\"5 years\",\"community service\"|"); 
    718721    $this->assert(!defined($s),$s); 
    719     TWiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
    720     $s = TWiki::Plugins::ActionTrackerPlugin::Action::extendTypes( 
     722    Foswiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
     723    $s = Foswiki::Plugins::ActionTrackerPlugin::Action::extendTypes( 
    721724        "|who,text,17|"); 
    722725    $this->assert_str_equals( 
    723726        'Attempt to redefine attribute \'who\' in EXTRAS',$s); 
    724     $s = TWiki::Plugins::ActionTrackerPlugin::Action::extendTypes("|fleegle|"); 
     727    $s = Foswiki::Plugins::ActionTrackerPlugin::Action::extendTypes("|fleegle|"); 
    725728    $this->assert_str_equals("Bad EXTRAS definition 'fleegle' in EXTRAS",$s ); 
    726     TWiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
     729    Foswiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
    727730} 
    728731 
     
    757760    $query->param( ACTION_NUMBER=> -99); 
    758761    my $action = 
    759       TWiki::Plugins::ActionTrackerPlugin::Action::createFromQuery( 
     762      Foswiki::Plugins::ActionTrackerPlugin::Action::createFromQuery( 
    760763          "Web","Topic",10,$query); 
    761764    my $chosen = $action->stringify(); 
     
    776779 
    777780    my $action = 
    778       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     781      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    779782          "Web", "Topic", 9, 
    780783          'state="open" creator="$this->{users_web}.Creator" notify="$this->{users_web}.Notifyee" closer="$this->{users_web}.Closer" due="4-May-2003" closed="2-May-2003" who="$this->{users_web}.Who" created="3-May-2003" uid="UID"', 
    781784          "Text"); 
    782     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( "|Who|", "|\$who|", "cols","",""); 
     785    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( "|Who|", "|\$who|", "cols","",""); 
    783786    my $s = $action->formatForEdit($fmt); 
    784787    # only the who field should be a text; the rest should be hiddens 
     
    797800    $s =~ s(<input (.*?name="due".*?)/>)(); 
    798801    $this->assert_matches(qr/type="hidden"/, $1); 
    799     $this->assert_matches(qr/value="Sun, 4 May 2003"/, $1); 
     802    $this->assert_matches(qr/value="4 May 2003"/, $1); 
    800803    $s =~ s(<input (.*?name="closed".*?)/>)(); 
    801804    $this->assert_matches(qr/type="hidden"/, $1); 
    802     $this->assert_matches(qr/value="Fri, 2 May 2003"/, $1); 
     805    $this->assert_matches(qr/value="2 May 2003"/, $1); 
    803806    $s =~ s(<input (.*?name="created".*?)/>)(); 
    804807    $this->assert_matches(qr/type="hidden"/, $1); 
    805     $this->assert_matches(qr/value="Sat, 3 May 2003"/, $1); 
     808    $this->assert_matches(qr/value="3 May 2003"/, $1); 
    806809    $s =~ s(<input (.*?name="uid".*?)/>)(); 
    807810    $this->assert_matches(qr/type="hidden"/, $1); 
     
    815818 
    816819    my $action = 
    817       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     820      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    818821          "Web", "Topic", 9, 
    819822          "state=\"open\" creator=\"$this->{users_web}.Creator\" notify=\"$this->{users_web}.Notifyee\" closer=\"$this->{users_web}.Closer\" due=\"4-May-2003\" closed=\"2-May-2003\" who=\"$this->{users_web}.Who\" created=\"3-May-2003\" uid=\"UID\"", 
     
    826829    $bods =~ s/(\w+)/\$$1/go; 
    827830 
    828     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( 
     831    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( 
    829832        $all, $bods, "",""); 
    830833    my $s = $action->formatForEdit($fmt); 
     
    841844    foreach my $n (split(/\|/,$expand)) { 
    842845        $this->assert($s =~ s(<th>$n<\/th>)(), $n); 
    843         require TWiki::Contrib::JSCalendarContrib; 
     846        require Foswiki::Contrib::JSCalendarContrib; 
    844847        if (!$@ && ($n eq "closed" || $n eq "due" || $n eq "created")) { 
    845848            $this->assert( 
     
    862865        } 
    863866    } 
    864     $this->assert($s =~ s/^\s*<table class="atpEdit">//); 
     867    $this->assert($s =~ s/^\s*<table class="atpSearch">//, $s); 
    865868    $this->assert($s =~ s/\s*<tr><\/tr>//, $s); 
    866869    $this->assert($s =~ s/\s*<tr>//); 
     
    876879 
    877880    $action = 
    878       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     881      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    879882          "Web", "Topic", 9, 
    880883          "state=\"open\" due=\"4-May-2001\"", "Test"); 
    881     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
    882     $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( "|Due|", "|\$due|", "",""); 
     884    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
     885    $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( "|Due|", "|\$due|", "",""); 
    883886    $s = $action->formatForEdit($fmt); 
    884887    $s =~ /value=\"(.*?)\"/; 
    885     $this->assert_str_equals($1, "Fri, 04 May 2001"); 
     888    $this->assert_str_equals($1, "04 May 2001"); 
    886889} 
    887890 
     
    889892    my $this = shift; 
    890893 
    891     my $s = TWiki::Plugins::ActionTrackerPlugin::Action::extendTypes("|state,select,17,life,\"5 years\",\"community service\"|"); 
     894    my $s = Foswiki::Plugins::ActionTrackerPlugin::Action::extendTypes("|state,select,17,life,\"5 years\",\"community service\"|"); 
    892895    $this->assert(!defined($s)); 
    893896    my $action = 
    894       new TWiki::Plugins::ActionTrackerPlugin::Action("Web", "Topic", 10, 
     897      new Foswiki::Plugins::ActionTrackerPlugin::Action("Web", "Topic", 10, 
    895898                                                      "state=\"5 years\"", "Text"); 
    896     my $fmt = new TWiki::Plugins::ActionTrackerPlugin::Format( "|State|", "|\$state|", "",""); 
     899    my $fmt = new Foswiki::Plugins::ActionTrackerPlugin::Format( "|State|", "|\$state|", "",""); 
    897900    $s = $action->formatForEdit($fmt); 
    898901    $s =~ s((<option value="life">life</option>))(); 
     
    912915    $s =~ s/\s+//go; 
    913916    $this->assert_str_equals("State", $s); 
    914     TWiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
     917    Foswiki::Plugins::ActionTrackerPlugin::Action::unextendTypes(); 
    915918} 
    916919 
     
    920923 
    921924    my $action = 
    922       new TWiki::Plugins::ActionTrackerPlugin::Action( 
     925      new Foswiki::Plugins::ActionTrackerPlugin::Action( 
    923926          "Test", "Topic", 0, 
    924927          'who="SlyStallone" state=open ', 
    925928          "A new action"); 
    926929 
    927     my $attrs = new TWiki::Attrs("who=$this->{users_web}.SlyStallone",1); 
    928     $this->assert($action->matches($attrs)); 
    929     $attrs = new TWiki::Attrs('state="open"',1); 
    930     $this->assert($action->matches($attrs)); 
    931  
    932     $attrs = new TWiki::Attrs("late",1); 
    933     $this->assert($action->matches($attrs)); 
    934  
    935     $attrs = new TWiki::Attrs("within='+1'",1); 
    936     $this->assert(!$action->matches($attrs)); 
    937     $attrs = new TWiki::Attrs("within='1'",1); 
    938     $this->assert($action->matches($attrs)); 
    939  
    940     TWiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
    941     $attrs = new TWiki::Attrs('due="31 May 02"',1); 
     930    my $attrs = new Foswiki::Attrs("who=$this->{users_web}.SlyStallone",1); 
     931    $this->assert($action->matches($attrs)); 
     932    $attrs = new Foswiki::Attrs('state="open"',1); 
     933    $this->assert($action->matches($attrs)); 
     934 
     935    $attrs = new Foswiki::Attrs("late",1); 
     936    $this->assert($action->matches($attrs)); 
     937 
     938    $attrs = new Foswiki::Attrs("within='+1'",1); 
     939    $this->assert(!$action->matches($attrs)); 
     940    $attrs = new Foswiki::Attrs("within='1'",1); 
     941    $this->assert($action->matches($attrs)); 
     942 
     943    Foswiki::Plugins::ActionTrackerPlugin::Action::forceTime("31 May 2002"); 
     944    $attrs = new Foswiki::Attrs('due="31 May 02"',1); 
    942945    $this->assert($action->matches($attrs)); 
    943946} 
Note: See TracChangeset for help on using the changeset viewer.