Changeset 6167


Ignore:
Timestamp:
01/27/10 17:41:17 (2 years ago)
Author:
MichaelDaum
Message:

Item2020:

  • fixed searching for custom action attributes
  • fixed action editor template
  • fixed adding css and js to the head
  • minor code and docu cleanup


Location:
trunk/ActionTrackerPlugin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ActionTrackerPlugin/data/System/ActionTrackerPlugin.txt

    r6103 r6167  
     1%META:TOPICINFO{author="micha" comment="reprev" date="1264608445" format="1.1" reprev="1.2" version="1.2"}% 
    12---+!! Action Tracker Plugin 
    23<!-- 
     
    1415This plugin provides support for tracking actions embedded in topics. Actions captured this way can then be searched from any topic in the wiki. 
    1516 
    16 ---+ Features 
     17%TOC% 
     18 
     19---++ Features 
     20 
    1721   * Actions are embedded in topics. 
    1822   * List actions using searches. 
     
    4044%TOC% 
    4145 
    42 --- 
    43 ---+ Syntax Rules 
    44  
    45 ---++ Actions 
     46---++ Syntax Rules 
     47 
     48---+++ Actions 
    4649 
    4750__Note:__ if you have used this plugin with TWiki you may note that the syntax of actions has changed. The plugin still recognises the old syntax, and will automatically upgrade topics when you edit them. 
    4851 
    4952Write the command =%<nop>ACTION{= _attributes_ =}% ...  %<nop>ENDACTION%= anywhere in a topic, where =...= represents the action description. Standard attributes are 
    50         | *Name* | *Value* | *Description* | *Auto-completed* | 
    51         | =who= | See [[#PeopleAnchor][People]] | The person or team responsible for completing the action. | current user | 
    52         | =due= | See [[#DateFormats][Date Formats]] | The due date | | 
    53         | =state= | =open= or =closed= | Set to =open= if the action is still open; set to =closed= if the action is closed. To extend the state set, see [[#NonStandardAttributes][Non-standard attributes]]. | open | 
    54         | =notify= | See [[#PeopleAnchor][People]] | wikinames, or e-mail addresses, of people to notify when the action changes. See [[#NotiFication][Notification]] for details on action notification. | | 
    55         | =creator= | See [[#PeopleAnchor][People]] | Who created the action. | current user | 
    56         | =created= | See [[#DateFormats][Date Formats]] | Date the action was created. | today | 
    57         | =closer= | See [[#PeopleAnchor][People]] | Who closed the action. | if (and only if) state="closed", current user | 
    58         | =closed= | See [[#DateFormats][Date Formats]] | Date the action was closed, if ever. | if (and only if) state="closed", today | 
    59         | =uid= | 6 digit number | Unique ID of the action. See [[#UiDs][UIDs]]. | calculated | 
     53   | *Name* | *Value* | *Description* | *Auto-completed* | 
     54   | =who= | See [[#PeopleAnchor][People]] | The person or team responsible for completing the action. | current user | 
     55   | =due= | See [[#DateFormats][Date Formats]] | The due date | | 
     56   | =state= | =open= or =closed= | Set to =open= if the action is still open; set to =closed= if the action is closed. To extend the state set, see [[#NonStandardAttributes][Non-standard attributes]]. | open | 
     57   | =notify= | See [[#PeopleAnchor][People]] | wikinames, or e-mail addresses, of people to notify when the action changes. See [[#NotiFication][Notification]] for details on action notification. | | 
     58   | =creator= | See [[#PeopleAnchor][People]] | Who created the action. | current user | 
     59   | =created= | See [[#DateFormats][Date Formats]] | Date the action was created. | today | 
     60   | =closer= | See [[#PeopleAnchor][People]] | Who closed the action. | if (and only if) state="closed", current user | 
     61   | =closed= | See [[#DateFormats][Date Formats]] | Date the action was closed, if ever. | if (and only if) state="closed", today | 
     62   | =uid= | 6 digit number | Unique ID of the action. See [[#UiDs][UIDs]]. | calculated | 
    6063 
    6164For example, 
     
    7477Note that the =due= field is not auto-completed. If you don't specify a due date for an action, the action is treated as due on a 'to be decided' (TBD) date. TBD actions are always shown in action searches, to help encourage you to timeframe them. 
    7578 
    76 ---++ Action searches 
     79---+++ Action searches 
    7780 
    7881Write the command =%<nop>ACTIONSEARCH{= _attributes_ =}%= anywhere in a topic. Standard attributes are 
    79         | *Name* | *Value* | *Description* | 
    80         | =who= | See [[#PeopleAnchor][People]] | Person responsible for closing the action. | 
    81         | =notify= | See [[#PeopleAnchor][People]] | Persons who want to be notified of a change | 
    82         | =state= | =late=, or any legal state value | Set to =late= to search for late actions; set to any any legal state value to search for actions in that state. See [[#SettingsAnchor][Settings]] for details on how to extend the state set. <br /> You can also use a Perl regular expression, which must match the entire state name e.g. =state="open&#124;closed"= will match either open or closed states, but no other states, and =state="(?!closed).*"= will match every state except =closed=. Google for =perlre= for help with Perl regular expressions. | 
     82 
     83   | *Name* | *Value* | *Description* | 
     84   | =who= | See [[#PeopleAnchor][People]] | Person responsible for closing the action. | 
     85   | =notify= | See [[#PeopleAnchor][People]] | Persons who want to be notified of a change | 
     86   | =state= | =late=, or any legal state value | Set to =late= to search for late actions; set to any any legal state value to search for actions in that state. See [[#SettingsAnchor][Settings]] for details on how to extend the state set. <br /> You can also use a Perl regular expression, which must match the entire state name e.g. =state="open&#124;closed"= will match either open or closed states, but no other states, and =state="(?!closed).*"= will match every state except =closed=. Google for =perlre= for help with Perl regular expressions. | 
    8387    | =within= | a number of days | Search for actions that are within a number of days of their due date. Usually used in conjunction with other attributes, such as <code>state="open"</code>. If you give it a simple number _N_, it will match actions that are due within _N_ days *either side* of the current date. If you give _N_ with a leading '+', this restricts the search to _N_ days in the future. If you give _N_ with a leading '-', it matches only actions that _fell due_ in the last _N_ days. | 
    84         | =web= | Perl regular expression | A regular expression that matches the names of all the webs to search. If this attribute is omitted, the default is to search only the current web. Searching many webs is much slower, especially in a large installation. Webs marked NOSEARCHALL will not be searched. |  
    85         | =topic= | Perl regular expression | A regular expression that matches the names of all the topics to search. If this attribute is omitted, the default is to search all the topics in the selected webs. |  
    86         | =due= | Absolute or relative date expression. See [[#DateFormats][Date Formats]] | Due date for the action. | 
    87         | =creator= | See [[#PeopleAnchor][People]] | Who created the action. | 
    88         | =created= | Absolute or relative date expression. See [[#DateFormats][Date Formats]] | Date the action was created. | 
    89         | =closed= | Absolute or relative date expression. See [[#DateFormats][Date Formats]] | Date the action was closed, if ever. | 
    90         | =closer= | See [[#PeopleAnchor][People]] | Who closed the action. | 
    91         | =uid= | 6 digit number | Unique ID of the action. | 
    92         | =format= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
    93         | =header= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
    94         | =footer= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
    95         | =orient= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
    96         | =separator= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
    97         | =sort= | Comma-separated list of field names | Fields to sort the matched actions by. For example, <code>sort="$who,$due"</code> will sort by who first and then due. This field is optional; by default the table will be sorted by due date. | 
     88   | =web= | Perl regular expression | A regular expression that matches the names of all the webs to search. If this attribute is omitted, the default is to search only the current web. Searching many webs is much slower, especially in a large installation. Webs marked NOSEARCHALL will not be searched. |  
     89   | =topic= | Perl regular expression | A regular expression that matches the names of all the topics to search. If this attribute is omitted, the default is to search all the topics in the selected webs. |  
     90   | =due= | Absolute or relative date expression. See [[#DateFormats][Date Formats]] | Due date for the action. | 
     91   | =creator= | See [[#PeopleAnchor][People]] | Who created the action. | 
     92   | =created= | Absolute or relative date expression. See [[#DateFormats][Date Formats]] | Date the action was created. | 
     93   | =closed= | Absolute or relative date expression. See [[#DateFormats][Date Formats]] | Date the action was closed, if ever. | 
     94   | =closer= | See [[#PeopleAnchor][People]] | Who closed the action. | 
     95   | =uid= | 6 digit number | Unique ID of the action. | 
     96   | =format= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
     97   | =header= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
     98   | =footer= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
     99   | =orient= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
     100   | =separator= | Presentation format | See [[#CustomIsation][Formatting tables]] | 
     101   | =sort= | Comma-separated list of field names | Fields to sort the matched actions by. For example, <code>sort="$who,$due"</code> will sort by who first and then due. This field is optional; by default the table will be sorted by due date. | 
     102 
    98103For example, 
    99104<pre> 
     
    112117 
    113118#DateFormats 
    114 ---+++ Date formats 
    115  
    116 ---++++ Absolute date formats 
     119---++++ Date formats 
     120 
     121---+++++ Absolute date formats 
     122 
    117123Absolute dates are required in action specifications. Date formats must be as recognised by =Time::Parse<nop>Date=. 
    118124The following absolute date formats are recognised. Dates containing spaces must be enclosed in double-quotes. 
    119         * Dow, dd Month yy 
    120         * Dow, dd Month yyyy 
    121         * Dow, dd Month 
    122         * dd Month yy 
    123         * dd Month yyyy 
    124         * Month day{st,nd,rd,th}, year 
    125         * Month dd yyyy 
    126         * yyyy/mm/dd 
    127         * yyyy/mm 
    128         * mm/dd/yy 
    129         * mm/dd/yyyy 
    130         * mm/yy 
    131         * yy/mm         (only if year > 12) 
    132         * yy/mm/dd      (only if year > 12 and day < 32) 
     125 
     126   * Dow, dd Month yy 
     127   * Dow, dd Month yyyy 
     128   * Dow, dd Month 
     129   * dd Month yy 
     130   * dd Month yyyy 
     131   * Month day{st,nd,rd,th}, year 
     132   * Month dd yyyy 
     133   * yyyy/mm/dd 
     134   * yyyy/mm 
     135   * mm/dd/yy 
     136   * mm/dd/yyyy 
     137   * mm/yy 
     138   * yy/mm      (only if year > 12) 
     139   * yy/mm/dd   (only if year > 12 and day < 32) 
    133140 
    134141You are *strongly* recommended never to use the 'mm/dd/yy or mm/dd/yyyy' formats, to avoid confusing users outside of the US, Micronesia, the Phillipines and Palau (these are the [[http://en.wikipedia.org/wiki/Calendar_date][only places in the world that use mm/dd/yyyy]]). Note that due to limitations in the Time::Parsedate module, dates before 1970 will not work as expected. 
    135142 
    136 ---++++ Relative date formats 
     143---+++++ Relative date formats 
     144 
    137145When you are searching for fields containing dates (such as =closed=, =created= and =due=) you can specify dates relative to the current date and time. For example: 
     146 
    138147| *Syntax* | *Example* | *Notes* | 
    139148| _Dow_ =after next=        | =Tuesday after next= | | 
     
    151160| =-= _count_ _units_       | =- 2 months=     | | 
    152161| _count_ _units_ =ago=     | =10 days ago=    | | 
     162 
    153163Valid _units_ are =minutes=, =hours=, =days=, =weeks=, =years=. 
    154164 
    155165#PeopleAnchor 
    156 ---+++ People 
     166---++++ People 
    157167 
    158168People are identified to the action tracker using a wikiname (e.g. =%MAINWEB%.William<nop>Wallace= or simply =William<nop>Wallace=) or an e-mail address (e.g. =a_einstein@<nop>pto.co.ch=). The e-mail address is useful if you want to notify people who aren't registered in the wiki, but bear in mind that if they are outside your firewall, they'll get action notifications but the chances are they won't be able to edit pages and close actions. _Very_ annoying! 
     
    162172You can also use the shorthand =me= for the currently logged-in user (this is the guest user unless you have been prompted for a username and password). In actions, this will automatically be expanded when the topic is saved, and in searches it will match the currently logged in user.  
    163173 
    164 ---++++ Groups 
     174---+++++ Groups 
    165175 
    166176You can assign an action to a group. Alternatively you can give a list of people as the value of the attribute. For example, 
     177 
    167178<pre> 
    168179%ACTION<nop>{who=AdminGroup ...}% 
    169180%ACTION<nop>{who="KnutHaraldsen,MagnusMagnusson" ...}% 
    170181</pre> 
     182 
    171183%RED% 
    172184__Note__ in general you should *not* use these mechanisms for assigning actions, because the actions so created are not specific. Actions should be assigned to one person only, so that it's clear who is responsible for them. 
     
    174186 
    175187#UiDs 
    176 ---+++ UIDs 
     188---++++ UIDs 
     189 
    177190_For administrators only_: 
    178191Each action is assigned a Unique Identifier (UID) when it is created. This UID is a six-digit number, and is generated when the action is first saved by incrementing a number in a special file (<code>pub/_work_areas/ActionTrackerPlugin/UIDRegister</code> under the installation). If this file is accidentally deleted, or is not writable, then you will have problems and you may get duplicate UIDs. Normally this won't matter a hoot, as UIDs only _have_ to be unique within a single topic, but if the file is persistantly inaccessible it could be a bit of a nuisance. 
    179192 
    180193#NotiFication 
    181 ---+ Notification 
     194---++ Notification 
    182195 
    183196ActionTrackerPlugin comes with a notifier script, like the =mailnotify= script used for WebNotify. This script allows you to: 
    184         * examine all the actions in all webs (except those specified NOSEARCHALL) and notify owners of the state of actions, 
    185         * find actions that have changed state, and notify people who have registered an interest in that action. 
     197 
     198   * examine all the actions in all webs (except those specified NOSEARCHALL) and notify owners of the state of actions, 
     199   * find actions that have changed state, and notify people who have registered an interest in that action. 
    186200 
    187201The frequency with which actions are notified depends on how you set up your cron (or equivalent) jobs on the server. 
    188202 
    189 %X% be careful what user you use to run this script. It will write the 
     203%H% Be careful what user you use to run this script. It will write the 
    190204Foswiki log files, and if these log files are left in a state where they 
    191205can't be written to by the Foswiki server, you may break your site. 
     
    197211 
    198212For example, you could set up the cron jobs as follows: 
     213 
    199214<pre> 
    2002150 * * * * cd /home/foswiki/bin && ../tools/actionnotify "state=\"late\"" 
     
    2032180 0 * * 1 cd /home/foswiki/bin && ../tools/actionnotify "state=\"open\" within=\"30\" 
    204219</pre> 
     220 
    205221(If you don't know cron, the first 5 fields are minute, hour, day of month, month and day of week. * means 'every'). This crontab will notify actions according to the schedule: 
    206         1 Actions that are late will be notified every hour, on the hour 
    207         2 Actions that are still open within three days of their due date will be notified twice a day, at 8am and 4pm 
    208         3 Actions that are still open within seven days of their due date will be notified once a day, at midnight. 
    209         4 Actions that are still open within thirty days of their due date will be notified once a week, at midnight on monday. 
     222   1 Actions that are late will be notified every hour, on the hour 
     223   2 Actions that are still open within three days of their due date will be notified twice a day, at 8am and 4pm 
     224   3 Actions that are still open within seven days of their due date will be notified once a day, at midnight. 
     225   4 Actions that are still open within thirty days of their due date will be notified once a week, at midnight on monday. 
    210226A rather aggressive schedule! 
    211227 
     
    218234 
    219235#TranslatingNamesToEmailAddresses 
    220 ---++ Translating names to e-mail addresses 
     236---+++ Translating names to e-mail addresses 
    221237 
    222238The wikiname of the user to be notified is translated to a mail address according to the following rules: 
    223         * If the user has a personal page, and that personal page contains a line or lines matching<br /> 
    224         _spaces_ * Email: _email address_ <br /> 
    225         or<br /> 
    226         _spaces_ * E-mail: _email address_ <br /> 
    227         Alternatively if the topic is a group definition (the name ends in 'Group') then the line<br /> _spaces_ * Set GROUP =<br /> is used to determine the wikinames of the people in the group. These are resolved to email addresses recursively. If that fails,  
    228         * If they appear in *any* WebNotify in *any* web, in the form of a line that gives an email address, then that address is used. 
    229         * If this fails and the 'who' name is a valid e-mail address, for example person@domain.co.uk, then that name is used. 
     239 
     240   * If the user has a personal page, and that personal page contains a line or lines matching<br /> 
     241   _spaces_ * Email: _email address_ <br /> 
     242   or<br /> 
     243   _spaces_ * E-mail: _email address_ <br /> 
     244   Alternatively if the topic is a group definition (the name ends in 'Group') then the line<br /> _spaces_ * Set GROUP =<br /> is used to determine the wikinames of the people in the group. These are resolved to email addresses recursively. If that fails,  
     245   * If they appear in *any* WebNotify in *any* web, in the form of a line that gives an email address, then that address is used. 
     246   * If this fails and the 'who' name is a valid e-mail address, for example person@domain.co.uk, then that name is used. 
    230247 
    231248__Note:__ If a name cannot be translated to an e-mail address using the mechanisms described above, a warning will be output to =data/warning.txt=.. 
    232249 
    233250The =actionnotify= script is also used to notify users who have registered an interest in being notified when an action changes. This function of the script is activated when you use the =changedsince= parameter. =changedsince= is used to specify the time period within which changed actions are interesting. Any action which has changed in the given period will be notified to all users who have registered an interest in that action using =notify=. The =changedsince= value is a relative date string, which uses the following formats  
    234         * =yesterday= 
    235         * =last= _dow_ 
    236         * =last week= 
    237         * =now= - _count_ _units_ 
    238         * <code>-</code> _count_ _units_ 
    239         * _count_ _units_ =ago= 
     251 
     252   * =yesterday= 
     253   * =last= _dow_ 
     254   * =last week= 
     255   * =now= - _count_ _units_ 
     256   * <code>-</code> _count_ _units_ 
     257   * _count_ _units_ =ago= 
     258 
    240259where _units_ may be minutes, days, hours, weeks, months or even years. _count_ is just an integer. _dow_ is the name of a day of the week. For example: 
     260 
    241261<pre> 
    242262changedsince="last monday" 
     
    253273 
    254274__Notes:__ 
    255         1 Not all action changes get notified, only changes to certain sensitive fields. You can change the set of fields that are sensitive to changes by setting the NOTIFYCHANGES parameter, as described in [[#SettingsAnchor][Settings]], below. 
    256         1 Unlike all other search terms, =changedsince= works as an OR term rather than an AND term. If you use a compound expression like <code>late,changedsince=yesterday</code>, this will *not* give you all late actions that changed since yesterday. Instead, it will give you all late actions *and* all actions that changed since yesterday. 
    257         1 If you give the parameter DEBUG to the actionnotify script, it will print out the mails that would have been sent to STDOUT. This is useful for debugging, and may be useful if you have some other processing in mind (such as piping to an alternative mail program). 
    258         1 =changedsince= requires RCS, and will not work with Rcs<nop>Lite. 
    259 --- 
     275   1 Not all action changes get notified, only changes to certain sensitive fields. You can change the set of fields that are sensitive to changes by setting the NOTIFYCHANGES parameter, as described in [[#SettingsAnchor][Settings]], below. 
     276   1 Unlike all other search terms, =changedsince= works as an OR term rather than an AND term. If you use a compound expression like <code>late,changedsince=yesterday</code>, this will *not* give you all late actions that changed since yesterday. Instead, it will give you all late actions *and* all actions that changed since yesterday. 
     277   1 If you give the parameter DEBUG to the actionnotify script, it will print out the mails that would have been sent to STDOUT. This is useful for debugging, and may be useful if you have some other processing in mind (such as piping to an alternative mail program). 
     278   1 =changedsince= requires RCS, and will not work with Rcs<nop>Lite. 
    260279#CustomIsation 
    261 ---+ Customisation 
    262  
    263 ---++ Formatting search tables 
     280---++ Customisation 
     281 
     282---+++ Formatting search tables 
    264283 
    265284The =header=, =footer, =format=, =separator= and =orient= parameters of =%<nop>ACTIONSEARCH{}%= support formatting of the action table using a similar syntax to that described in %SYSTEMWEB%.FormattedSearch. For example: 
     285 
    266286<pre> 
    267287%<nop>ACTIONSEARCH{ web="Directors" state="open" format="|$who|$text|$edit|" header="|*Director*|*Films*||" footer="|*Director*|*Films*|" separator="$n" orient="rows" }% 
    268288</pre> 
     289 
    269290The available =$formattingtokens= are: 
     291 
    270292| *Name:* | *Expands To:* | 
    271293| =$who= | Who is responsible for the action | 
     
    288310| =$dollar= | Dollar sign (=$=) | 
    289311| =$statebutton(name,state)= | Displays a button that will change the current state of the action to the named state. If the action is already in that state, nothing is displayed. =name= is the string used in the button and =state= is the name of the target state e.g. =$statebutton(Close,closed)= | 
     312 
    290313The header and format parameters can also be used with the actionnotify script. 
    291314 
     
    293316 
    294317#NonStandardAttributes 
    295 ---++ Non-standard Attributes 
     318---+++ Non-standard Attributes 
    296319 
    297320As well as the standard attributes you can add non-standard attributes to actions, and use them in searches. For example: 
     321 
    298322<pre> 
    299323%<nop>ACTION{ who="EmperorHadrian" due="1 Jan 0053" state="closed" legion="7th" cohort="6th" maniple="3rd" }% Build a wall to keep the Scots out of England %<nop>ENDACTION% 
     
    304328 
    305329To define non-standard attributes you need to set the value of ACTIONTRACKERPLUGIN_EXTRAS - see [[#SettingsAnchor][Settings]] below. All attributes must be given a type, which is used by the formatter, the search engine and the action editor. For example, 
    306 <pre> 
    307         * <nop>Set ACTIONTRACKERPLUGIN_EXTRAS = |plaintiffs,names,16|decision,text,16|sentencing,date|sentence,select,"life","5 years","community service"| 
    308 </pre> 
     330 
     331<pre> 
     332   * <nop>Set ACTIONTRACKERPLUGIN_EXTRAS = |plaintiffs,names,16|decision,text,16|sentencing,date|sentence,select,"life","5 years","community service"| 
     333</pre> 
     334 
    309335The following types are supported: 
     336 
    310337| *Type* | *Format* | *Description* | 
    311338| =select= | select, <i>size</i>, "option 1", "option 2", ... | Can take one of the string values option1, option2,.... etc. | 
     
    313340| =text= | text, <i>size</i> | An arbitrary text field | 
    314341| =date= | date, <i>size</i> | A date in one of the formats described above. See [[#DateFormats][Date Formats]] | 
     342 
    315343In the above, <i>size</i> is a single number, which is the width (in characters) of the text box in the action editor for =text=, =names= and =date=, and the number of options to show in =select=.. 
    316344 
    317345__Note__ that there is one exception to the "no redefinition" rule above; the =state= attribute can be extended to take extra states. However if you want the closure functionality (closed, closer, and late actions) to work, the =closed= state must be retained. To extend the set of states, simply include a definition of =state= in the ACTIONTRACKERPLUGIN_EXTRAS definition: 
    318 <pre> 
    319         * <nop>Set ACTIONTRACKERPLUGIN_EXTRAS = |state,select,1,"open","fried","boiled","poached","closed"| 
    320 </pre> 
    321  
    322 ---++ Searching for non-standard attributes 
     346 
     347<pre> 
     348   * <nop>Set ACTIONTRACKERPLUGIN_EXTRAS = |state,select,1,"open","fried","boiled","poached","closed"| 
     349</pre> 
     350 
     351---+++ Searching for non-standard attributes 
     352 
    323353You can of course search for values of non-standard attributes. For example: 
     354 
    324355<pre> 
    325356%<nop>ACTIONSEARCH{ sentence="life" }% 
    326357</pre> 
     358 
    327359If a non-standard attribute is declared as type =text= you can use perl regular expressions in the search. Searches for values of type =names= will match any-to-any. For example, 
    328360 
     
    332364 
    333365will match both of the following actions: 
     366 
    334367<pre> 
    335368%<nop>ACTION{ car="VolkswagenBeetle,AudiSport" ... }% ... %<nop>ENDACTION% 
     
    337370</pre> 
    338371 
    339 --- 
    340372#SettingsAnchor 
    341 ---+ <nop>ActionTrackerPlugin Settings 
     373---++ <nop>ActionTrackerPlugin Settings 
    342374<!-- 
    343         * Set SHORTDESCRIPTION = %$SHORTDESCRIPTION% 
     375   * Set SHORTDESCRIPTION = %$SHORTDESCRIPTION% 
    344376--> 
     377 
    345378The following preferences control different aspects of the action tracker's behaviour. 
    346379You can override the defaults for these preferences in %USERSWEB%.<nop>SitePreferences, the Web<nop>Preferences topic of the current web, or in individual topics, using the standard 'Set' syntax e.g: 
     380 
    347381<pre> 
    348382   *<nop> Set ACTIONTRACKERPLUGIN_EDITORIENT = rows 
    349383</pre> 
    350 ---++ Formatting how actions are displayed 
     384 
     385---+++ Formatting how actions are displayed 
     386 
    351387The 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. 
    352 | _Preference_ | _Default_ | 
     388 
     389| *Preference* | *Default* | 
    353390| =ACTIONTRACKERPLUGIN_TABLEHEADER= | =&#124; Assigned to &#124; Due date &#124; Description &#124; State &#124; Notify &#124;&#124;= | 
    354391| =ACTIONTRACKERPLUGIN_TABLEFORMAT= | =&#124; $who &#124; $due &#124; $text $link &#124; $state &#124; $notify &#124; $edit &#124;= | 
    355392| =ACTIONTRACKERPLUGIN_TABLEORIENT= | =cols= | 
     393 
    356394The alternative text format of an action, as seen by a mail recipient who doesn't accept HTML in mail. Used when mailing action or change notifications. 
     395 
    357396| =ACTIONTRACKERPLUGIN_TEXTFORMAT= | =Action for $who, due $due, $state$n$text$n= | 
    358397Full URL of the CSS to use in formatting actions. This file is also called from the mail generated by the =actionnotify= script, so you have to use an absolute URL here, and the URL has to be visible to anyone who might receive an action notification. 
    359 | _Preference_ | _Default_ | 
     398 
     399| *Preference* | *Default* | 
    360400| =ACTIONTRACKERPLUGIN_CSS= | =%<nop>PUBURL%/%<nop>SYSTEMWEB%/ActionTrackerPlugin/styles.css= | 
    361401If an action has no due date defined when it is created, then it is treated (for sorting etc) as if it was due at this time. This is a number of seconds since 1st Jan 1970, and should be 0 to sort actions that have no due date to the start of a list, or a very large number to sort them to the end. 
    362 | _Preference_ | _Default_ | 
     402 
     403| *Preference* | *Default* | 
    363404| =ACTIONTRACKERPLUGIN_DEFAULTDUE= | =9999999999= | 
    364 ---++ Formatting actions for editing 
     405 
     406---+++ Formatting actions for editing 
     407 
    365408The format of the fields in the action editor are set by: 
    366 | _Preference_ | _Default_ | 
     409 
     410| *Preference* | *Default* | 
    367411| =ACTIONTRACKERPLUGIN_EDITHEADER= | =&#124; Assigned to &#124; Due date &#124; State &#124; Notify &#124;= | 
    368412| =ACTIONTRACKERPLUGIN_EDITFORMAT= | =&#124; $who &#124; $due &#124; $state &#124; $notify &#124;= | 
    369413| ACTIONTRACKERPLUGIN_EDITORIENT | =cols= | 
     414 
    370415You can also override the default =EDITBOXWIDTH= and =EDITBOXHEIGHT= settings just for the action editor: 
    371 | _Preference_ | _Default_ | 
     416 
     417| *Preference* | *Default* | 
    372418| =ACTIONTRACKERPLUGIN_EDITBOXWIDTH= | =%EDITBOXWIDTH%= | 
    373419| =ACTIONTRACKERPLUGIN_EDITBOXHEIGHT= | =%EDITBOXHEIGHT%= | 
     420 
    374421If you prefer the action editor to use the same browser window to edit an action, or you don't have Javascript, set this to =0=. If set to 1 will edit an action in a separate browser window. 
    375 | _Preference_ | _Default_ | 
     422 
     423| *Preference* | *Default* | 
    376424| =ACTIONTRACKERPLUGIN_USENEWWINDOW= | =1= | 
    377425 
    378426If you want the action editor to offer a 'Preview Changes' button, instead of the usual 'Save Changes', set this to =0=. If this is set, and =USENEWWINDOW= is =1=, the subwindow _should_ close on save, but it won't because I haven't worked out how to do this safely in Java<nop>Script. 
    379 | _Preference_ | _Default_ | 
     427 
     428| *Preference* | *Default* | 
    380429| =ACTIONTRACKERPLUGIN_NOPREVIEW= | =1= | 
    381430 
    382431#SettingsNotify 
    383432The fields to scan to detect changes for actionnotify. Changes in other fields are ignored. 
    384 | _Preference_ | _Default_ | 
     433 
     434| *Preference* | *Default* | 
    385435| =ACTIONTRACKERPLUGIN_NOTIFYCHANGES= | =$who,$due,$state,$text= | 
    386436 
    387437Non-standard attributes - see [[#NonStandardAttributes][Non-standard attributes]] above. 
    388 | _Preference_ | _Default_ | 
     438 
     439| *Preference* | *Default* | 
    389440| =ACTIONTRACKERPLUGIN_EXTRAS= | _none_ | 
    390441 
    391442If set to 1, the action tracker will show action states using a drop-down menu, to allow viewers to quickly and easily change action states. You can disable this feature by setting this to 0. 
    392 | _Preference_ | _Default_ | 
     443 
     444| *Preference* | *Default* | 
    393445| =ACTIONTRACKERPLUGIN_ENABLESTATESHORTCUT= | =1= | 
     446 
    394447Note that each state has an associated CSS class (e.g. =atpStateopen=) that is used to render the HTML 'select' element when =ENABLESTATESHORTCUT= is on. If you extend the range of states, you will need to add new CSS classes as well. 
    395448 
    396449The strings used by the =$button$ switch. A =$closebutton= is a special 
    397 | _Preference_ | _Default_ | 
     450 
     451| *Preference* | *Default* | 
    398452| =ACTIONTRACKERPLUGIN_CLOSEBUTTONNAME= | =Close= | 
    399453| =ACTIONTRACKERPLUGIN_CLOSEBUTTONCLOSED= | =Closed= | 
    400454  
    401 ---++ Debugging 
     455---+++ Debugging 
     456 
    402457Set to 1 to enable debug features, including the undocumented =%<nop>ACTIONNOTIFICATIONS{}%= and =%<nop>ACTIONTRACKERPREFS%= features. 
    403 | _Preference_ | _Default_ | 
     458 
     459| *Preference* | *Default* | 
    404460| =ACTIONTRACKERPLUGIN_DEBUG= | =0= | 
    405461 
    406 --- 
    407 ---+ Plugin Installation Instructions 
     462---++ Plugin Installation Instructions 
    408463 
    409464%$INSTALL_INSTRUCTIONS% 
    410         * If the plugin is installed and enabled correctly you should see a formatted action below: 
     465   * If the plugin is installed and enabled correctly you should see a formatted action below: 
    411466%ACTION{who=WikiGuest,due="1 Jan 2003",open}% Example action %ENDACTION% 
    412         * ... and the result of a formatted search below: 
     467   * ... and the result of a formatted search below: 
    413468%ACTIONSEARCH{topic=ActionTrackerPlugin who=WikiGuest header="|Who|Due|State|Description|" format="| $who |$due|$state|$text $link|" orient="rows" }% 
    414469 
    415470Note that if you want to use the =action= template shipped with the Foswiki:Extensions.CommentPlugin to create actions, then you must put the !CommentPlugin *before* the !ActionTrackerPlugin in the ={PluginsOrder}= configuration option. 
    416471 
    417 ---+ Plugin Info 
     472---++ Plugin Info 
    418473 
    419474Another great Foswiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - __Working together to improve your wiki experience__! 
    420475 
    421476Thanks are due to the following sponsors, who have helped make this plugin possible: 
     477 
    422478   * [[http://motorola.com][Motorola]] 
    423479   * [[http://windriver.com][Wind River Systems]] 
  • trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin.pm

    r6103 r6167  
    2222use Error qw( :try ); 
    2323 
    24 require Foswiki::Func; 
    25 require Foswiki::Plugins; 
     24use Foswiki::Func (); 
     25use Foswiki::Plugins (); 
    2626 
    2727our $VERSION = '$Rev$'; 
     
    7878    return unless ( $_[0] =~ m/%ACTION.*{.*}%/o ); 
    7979 
    80     return unless _lazyInit( $web, $topic ); 
     80    return unless lazyInit( $web, $topic ); 
    8181 
    8282    _addCSSAndJS(); 
     
    155155 
    156156    if ( $cc < $oc ) { 
    157         return unless _lazyInit( $_[2], $_[1] ); 
     157        return unless lazyInit( $_[2], $_[1] ); 
    158158 
    159159        my $as = 
     
    167167    my ( $text, $topic, $web, $meta ) = @_; 
    168168 
    169     return unless _lazyInit( $web, $topic ); 
     169    return unless lazyInit( $web, $topic ); 
    170170 
    171171    my $query = Foswiki::Func::getCgiQuery(); 
     
    274274 
    275275    # Add styles and javascript for the calendar 
    276     Foswiki::Func::addToHEAD( 'ATP_CSS', 
    277 '<style type="text/css" media="all">@import url("%ACTIONTRACKERPLUGIN_CSS%");</style>' 
    278     ); 
     276    _addCSSAndJS(); 
    279277 
    280278    use Foswiki::Contrib::JSCalendarContrib; 
     
    308306    return unless ( $query->param('closeactioneditor') ); 
    309307 
    310     return unless _lazyInit( $_[2], $_[1] ); 
     308    return unless lazyInit( $_[2], $_[1] ); 
    311309 
    312310    my $pretext = $query->param('pretext') || ""; 
     
    348346    return unless $text; 
    349347 
    350     return unless _lazyInit( $web, $topic ); 
     348    return unless lazyInit( $web, $topic ); 
    351349 
    352350    my $query = Foswiki::Func::getCgiQuery(); 
     
    427425    my ( $session, $attrs, $topic, $web ) = @_; 
    428426 
    429     return unless _lazyInit( $web, $topic ); 
     427    return unless lazyInit( $web, $topic ); 
    430428 
    431429    _addCSSAndJS(); 
     
    461459 
    462460# Lazy initialize of plugin 'cause of performance 
    463 sub _lazyInit { 
     461sub lazyInit { 
    464462    my ( $web, $topic ) = @_; 
    465463 
     
    538536        ( $web, $topic ) = 
    539537          Foswiki::Func::normalizeWebTopicName( undef, $topic ); 
    540         _lazyInit( $web, $topic ); 
     538        lazyInit( $web, $topic ); 
    541539        _updateSingleAction( $web, $topic, $query->param('uid'), 
    542540            $query->param('field') => $query->param('value') ); 
  • trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm

    r5434 r6167  
    4040use integer; 
    4141 
    42 require CGI; 
    43 require Text::Soundex; 
    44 require Time::ParseDate; 
    45  
    46 require Foswiki::Func; 
    47 require Foswiki::Attrs; 
    48  
    49 require Foswiki::Plugins::ActionTrackerPlugin::AttrDef; 
    50 require Foswiki::Plugins::ActionTrackerPlugin::Format; 
     42use CGI (); 
     43use Text::Soundex (); 
     44use Time::ParseDate (); 
     45 
     46use Foswiki::Func (); 
     47use Foswiki::Attrs (); 
     48 
     49use Foswiki::Plugins::ActionTrackerPlugin::AttrDef (); 
     50use Foswiki::Plugins::ActionTrackerPlugin::Format (); 
    5151 
    5252our $now = time(); 
     
    227227    $defs =~ s/^\s*\|//o; 
    228228    $defs =~ s/\|\s*$//o; 
     229 
    229230    foreach my $def ( split( /\s*\|\s*/, $defs ) ) { 
    230231        if ( $def =~ m/^\s*(\w+)\s*,\s*(\w+)\s*(,\s*(\d+)\s*)?(,\s*(.*))?$/o ) { 
     
    625626        my $class    = ref($this); 
    626627        if ( defined( &{ $class . "::_matchField_$attrName" } ) ) { 
    627  
    628628            # function match 
    629629            my $fn = "_matchField_$attrName"; 
     
    643643            && defined( $this->{$attrName} ) ) 
    644644        { 
    645  
    646645            # re match 
    647646            my $r; 
  • trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm

    r2987 r6167  
    2525use locale; 
    2626 
    27 require Time::ParseDate; 
    28  
    29 require Foswiki::Net; 
    30  
    31 require Foswiki::Attrs; 
    32  
    33 require Foswiki::Plugins::ActionTrackerPlugin::Action; 
    34 require Foswiki::Plugins::ActionTrackerPlugin::ActionSet; 
    35 require Foswiki::Plugins::ActionTrackerPlugin::Format; 
     27use Time::ParseDate (); 
     28use Foswiki::Net (); 
     29use Foswiki::Attrs (); 
     30use Foswiki::Plugins::ActionTrackerPlugin (); 
    3631 
    3732my $wikiWordRE; 
    3833my $options; 
    3934 
    40 require Foswiki::Plugins::ActionTrackerPlugin::Options; 
    41  
    4235# PUBLIC actionnotify script entry point. Reinitialises Foswiki. 
    4336# 
     
    5245    # Assign SESSION so that Func methods work 
    5346    $Foswiki::Plugins::SESSION = $session; 
     47 
     48    Foswiki::Plugins::ActionTrackerPlugin::lazyInit($session->{webName}, $session->{topicName}); 
    5449 
    5550    if ( $expr =~ s/DEBUG//o ) { 
  • trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm

    r6103 r6167  
    305305 
    306306    foreach my $topic ( keys %$grep ) { 
    307  
    308307        # SMELL: always read the text, because it's faster in the current 
    309308        # impl to find the perms embedded in it 
  • trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm

    r5434 r6167  
    3232use integer; 
    3333 
    34 require Foswiki::Func; 
     34use Foswiki::Func (); 
    3535 
    3636# PUBLIC Constructor 
  • trunk/ActionTrackerPlugin/templates/edit.action.tmpl

    r2241 r6167  
    1 %TMPL:INCLUDE{"foswiki"}% 
     1%TMPL:INCLUDE{"edit"}% 
    22%TMPL:DEF{"copyright"}%%TMPL:END% 
    3 %TMPL:DEF{"main"}% 
     3%TMPL:DEF{"content"}% 
    44%UNENCODED_TEXT% 
    55%TMPL:END% 
Note: See TracChangeset for help on using the changeset viewer.