Changeset 6167
- Timestamp:
- 01/27/10 17:41:17 (2 years ago)
- Location:
- trunk/ActionTrackerPlugin
- Files:
-
- 7 edited
-
data/System/ActionTrackerPlugin.txt (modified) (18 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin.pm (modified) (10 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm (modified) (4 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm (modified) (2 diffs)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm (modified) (1 diff)
-
lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm (modified) (1 diff)
-
templates/edit.action.tmpl (modified) (1 diff)
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"}% 1 2 ---+!! Action Tracker Plugin 2 3 <!-- … … 14 15 This plugin provides support for tracking actions embedded in topics. Actions captured this way can then be searched from any topic in the wiki. 15 16 16 ---+ Features 17 %TOC% 18 19 ---++ Features 20 17 21 * Actions are embedded in topics. 18 22 * List actions using searches. … … 40 44 %TOC% 41 45 42 --- 43 ---+ Syntax Rules 44 45 ---++ Actions 46 ---++ Syntax Rules 47 48 ---+++ Actions 46 49 47 50 __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. 48 51 49 52 Write 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 | 60 63 61 64 For example, … … 74 77 Note 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. 75 78 76 ---++ Action searches79 ---+++ Action searches 77 80 78 81 Write 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|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|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. | 83 87 | =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 98 103 For example, 99 104 <pre> … … 112 117 113 118 #DateFormats 114 ---+++ Date formats 115 116 ---++++ Absolute date formats 119 ---++++ Date formats 120 121 ---+++++ Absolute date formats 122 117 123 Absolute dates are required in action specifications. Date formats must be as recognised by =Time::Parse<nop>Date=. 118 124 The 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) 133 140 134 141 You 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. 135 142 136 ---++++ Relative date formats 143 ---+++++ Relative date formats 144 137 145 When 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 138 147 | *Syntax* | *Example* | *Notes* | 139 148 | _Dow_ =after next= | =Tuesday after next= | | … … 151 160 | =-= _count_ _units_ | =- 2 months= | | 152 161 | _count_ _units_ =ago= | =10 days ago= | | 162 153 163 Valid _units_ are =minutes=, =hours=, =days=, =weeks=, =years=. 154 164 155 165 #PeopleAnchor 156 ---+++ People166 ---++++ People 157 167 158 168 People 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! … … 162 172 You 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. 163 173 164 ---++++ Groups174 ---+++++ Groups 165 175 166 176 You can assign an action to a group. Alternatively you can give a list of people as the value of the attribute. For example, 177 167 178 <pre> 168 179 %ACTION<nop>{who=AdminGroup ...}% 169 180 %ACTION<nop>{who="KnutHaraldsen,MagnusMagnusson" ...}% 170 181 </pre> 182 171 183 %RED% 172 184 __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. … … 174 186 175 187 #UiDs 176 ---+++ UIDs 188 ---++++ UIDs 189 177 190 _For administrators only_: 178 191 Each 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. 179 192 180 193 #NotiFication 181 ---+ Notification194 ---++ Notification 182 195 183 196 ActionTrackerPlugin 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. 186 200 187 201 The frequency with which actions are notified depends on how you set up your cron (or equivalent) jobs on the server. 188 202 189 % X% be careful what user you use to run this script. It will write the203 %H% Be careful what user you use to run this script. It will write the 190 204 Foswiki log files, and if these log files are left in a state where they 191 205 can't be written to by the Foswiki server, you may break your site. … … 197 211 198 212 For example, you could set up the cron jobs as follows: 213 199 214 <pre> 200 215 0 * * * * cd /home/foswiki/bin && ../tools/actionnotify "state=\"late\"" … … 203 218 0 0 * * 1 cd /home/foswiki/bin && ../tools/actionnotify "state=\"open\" within=\"30\" 204 219 </pre> 220 205 221 (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 hour207 2 Actions that are still open within three days of their due date will be notified twice a day, at 8am and 4pm208 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. 210 226 A rather aggressive schedule! 211 227 … … 218 234 219 235 #TranslatingNamesToEmailAddresses 220 ---++ Translating names to e-mail addresses236 ---+++ Translating names to e-mail addresses 221 237 222 238 The 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. 230 247 231 248 __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=.. 232 249 233 250 The =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 240 259 where _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 241 261 <pre> 242 262 changedsince="last monday" … … 253 273 254 274 __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. 260 279 #CustomIsation 261 ---+ Customisation262 263 ---++ Formatting search tables280 ---++ Customisation 281 282 ---+++ Formatting search tables 264 283 265 284 The =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 266 286 <pre> 267 287 %<nop>ACTIONSEARCH{ web="Directors" state="open" format="|$who|$text|$edit|" header="|*Director*|*Films*||" footer="|*Director*|*Films*|" separator="$n" orient="rows" }% 268 288 </pre> 289 269 290 The available =$formattingtokens= are: 291 270 292 | *Name:* | *Expands To:* | 271 293 | =$who= | Who is responsible for the action | … … 288 310 | =$dollar= | Dollar sign (=$=) | 289 311 | =$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 290 313 The header and format parameters can also be used with the actionnotify script. 291 314 … … 293 316 294 317 #NonStandardAttributes 295 ---++ Non-standard Attributes318 ---+++ Non-standard Attributes 296 319 297 320 As well as the standard attributes you can add non-standard attributes to actions, and use them in searches. For example: 321 298 322 <pre> 299 323 %<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% … … 304 328 305 329 To 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 309 335 The following types are supported: 336 310 337 | *Type* | *Format* | *Description* | 311 338 | =select= | select, <i>size</i>, "option 1", "option 2", ... | Can take one of the string values option1, option2,.... etc. | … … 313 340 | =text= | text, <i>size</i> | An arbitrary text field | 314 341 | =date= | date, <i>size</i> | A date in one of the formats described above. See [[#DateFormats][Date Formats]] | 342 315 343 In 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=.. 316 344 317 345 __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 323 353 You can of course search for values of non-standard attributes. For example: 354 324 355 <pre> 325 356 %<nop>ACTIONSEARCH{ sentence="life" }% 326 357 </pre> 358 327 359 If 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, 328 360 … … 332 364 333 365 will match both of the following actions: 366 334 367 <pre> 335 368 %<nop>ACTION{ car="VolkswagenBeetle,AudiSport" ... }% ... %<nop>ENDACTION% … … 337 370 </pre> 338 371 339 ---340 372 #SettingsAnchor 341 ---+ <nop>ActionTrackerPlugin Settings373 ---++ <nop>ActionTrackerPlugin Settings 342 374 <!-- 343 * Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%375 * Set SHORTDESCRIPTION = %$SHORTDESCRIPTION% 344 376 --> 377 345 378 The following preferences control different aspects of the action tracker's behaviour. 346 379 You 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 347 381 <pre> 348 382 *<nop> Set ACTIONTRACKERPLUGIN_EDITORIENT = rows 349 383 </pre> 350 ---++ Formatting how actions are displayed 384 385 ---+++ Formatting how actions are displayed 386 351 387 The default format of an action output, unless overridden by =format=, =header= etc. The following fields can be output: =web=, =topic=, =text=, =who=, =due=, =notify=, =uid=, =creator=, =state=, =edit=, and any =ACTIONTRACKERPLUGIN_EXTRAS= you may have. =TABLEHEADER= defines the column headings, =TABLEFORMAT= defines the contents of the columns, and if =TABLEORIENT= is set to =rows=, action tables will be aligned as rows of values instead of the default columns of values. 352 | _Preference_ | _Default_ | 388 389 | *Preference* | *Default* | 353 390 | =ACTIONTRACKERPLUGIN_TABLEHEADER= | =| Assigned to | Due date | Description | State | Notify ||= | 354 391 | =ACTIONTRACKERPLUGIN_TABLEFORMAT= | =| $who | $due | $text $link | $state | $notify | $edit |= | 355 392 | =ACTIONTRACKERPLUGIN_TABLEORIENT= | =cols= | 393 356 394 The 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 357 396 | =ACTIONTRACKERPLUGIN_TEXTFORMAT= | =Action for $who, due $due, $state$n$text$n= | 358 397 Full 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* | 360 400 | =ACTIONTRACKERPLUGIN_CSS= | =%<nop>PUBURL%/%<nop>SYSTEMWEB%/ActionTrackerPlugin/styles.css= | 361 401 If 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* | 363 404 | =ACTIONTRACKERPLUGIN_DEFAULTDUE= | =9999999999= | 364 ---++ Formatting actions for editing 405 406 ---+++ Formatting actions for editing 407 365 408 The format of the fields in the action editor are set by: 366 | _Preference_ | _Default_ | 409 410 | *Preference* | *Default* | 367 411 | =ACTIONTRACKERPLUGIN_EDITHEADER= | =| Assigned to | Due date | State | Notify |= | 368 412 | =ACTIONTRACKERPLUGIN_EDITFORMAT= | =| $who | $due | $state | $notify |= | 369 413 | ACTIONTRACKERPLUGIN_EDITORIENT | =cols= | 414 370 415 You can also override the default =EDITBOXWIDTH= and =EDITBOXHEIGHT= settings just for the action editor: 371 | _Preference_ | _Default_ | 416 417 | *Preference* | *Default* | 372 418 | =ACTIONTRACKERPLUGIN_EDITBOXWIDTH= | =%EDITBOXWIDTH%= | 373 419 | =ACTIONTRACKERPLUGIN_EDITBOXHEIGHT= | =%EDITBOXHEIGHT%= | 420 374 421 If 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* | 376 424 | =ACTIONTRACKERPLUGIN_USENEWWINDOW= | =1= | 377 425 378 426 If 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* | 380 429 | =ACTIONTRACKERPLUGIN_NOPREVIEW= | =1= | 381 430 382 431 #SettingsNotify 383 432 The fields to scan to detect changes for actionnotify. Changes in other fields are ignored. 384 | _Preference_ | _Default_ | 433 434 | *Preference* | *Default* | 385 435 | =ACTIONTRACKERPLUGIN_NOTIFYCHANGES= | =$who,$due,$state,$text= | 386 436 387 437 Non-standard attributes - see [[#NonStandardAttributes][Non-standard attributes]] above. 388 | _Preference_ | _Default_ | 438 439 | *Preference* | *Default* | 389 440 | =ACTIONTRACKERPLUGIN_EXTRAS= | _none_ | 390 441 391 442 If 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* | 393 445 | =ACTIONTRACKERPLUGIN_ENABLESTATESHORTCUT= | =1= | 446 394 447 Note 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. 395 448 396 449 The strings used by the =$button$ switch. A =$closebutton= is a special 397 | _Preference_ | _Default_ | 450 451 | *Preference* | *Default* | 398 452 | =ACTIONTRACKERPLUGIN_CLOSEBUTTONNAME= | =Close= | 399 453 | =ACTIONTRACKERPLUGIN_CLOSEBUTTONCLOSED= | =Closed= | 400 454 401 ---++ Debugging 455 ---+++ Debugging 456 402 457 Set to 1 to enable debug features, including the undocumented =%<nop>ACTIONNOTIFICATIONS{}%= and =%<nop>ACTIONTRACKERPREFS%= features. 403 | _Preference_ | _Default_ | 458 459 | *Preference* | *Default* | 404 460 | =ACTIONTRACKERPLUGIN_DEBUG= | =0= | 405 461 406 --- 407 ---+ Plugin Installation Instructions 462 ---++ Plugin Installation Instructions 408 463 409 464 %$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: 411 466 %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: 413 468 %ACTIONSEARCH{topic=ActionTrackerPlugin who=WikiGuest header="|Who|Due|State|Description|" format="| $who |$due|$state|$text $link|" orient="rows" }% 414 469 415 470 Note 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. 416 471 417 ---+ Plugin Info472 ---++ Plugin Info 418 473 419 474 Another 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__! 420 475 421 476 Thanks are due to the following sponsors, who have helped make this plugin possible: 477 422 478 * [[http://motorola.com][Motorola]] 423 479 * [[http://windriver.com][Wind River Systems]] -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin.pm
r6103 r6167 22 22 use Error qw( :try ); 23 23 24 require Foswiki::Func;25 require Foswiki::Plugins;24 use Foswiki::Func (); 25 use Foswiki::Plugins (); 26 26 27 27 our $VERSION = '$Rev$'; … … 78 78 return unless ( $_[0] =~ m/%ACTION.*{.*}%/o ); 79 79 80 return unless _lazyInit( $web, $topic );80 return unless lazyInit( $web, $topic ); 81 81 82 82 _addCSSAndJS(); … … 155 155 156 156 if ( $cc < $oc ) { 157 return unless _lazyInit( $_[2], $_[1] );157 return unless lazyInit( $_[2], $_[1] ); 158 158 159 159 my $as = … … 167 167 my ( $text, $topic, $web, $meta ) = @_; 168 168 169 return unless _lazyInit( $web, $topic );169 return unless lazyInit( $web, $topic ); 170 170 171 171 my $query = Foswiki::Func::getCgiQuery(); … … 274 274 275 275 # 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(); 279 277 280 278 use Foswiki::Contrib::JSCalendarContrib; … … 308 306 return unless ( $query->param('closeactioneditor') ); 309 307 310 return unless _lazyInit( $_[2], $_[1] );308 return unless lazyInit( $_[2], $_[1] ); 311 309 312 310 my $pretext = $query->param('pretext') || ""; … … 348 346 return unless $text; 349 347 350 return unless _lazyInit( $web, $topic );348 return unless lazyInit( $web, $topic ); 351 349 352 350 my $query = Foswiki::Func::getCgiQuery(); … … 427 425 my ( $session, $attrs, $topic, $web ) = @_; 428 426 429 return unless _lazyInit( $web, $topic );427 return unless lazyInit( $web, $topic ); 430 428 431 429 _addCSSAndJS(); … … 461 459 462 460 # Lazy initialize of plugin 'cause of performance 463 sub _lazyInit {461 sub lazyInit { 464 462 my ( $web, $topic ) = @_; 465 463 … … 538 536 ( $web, $topic ) = 539 537 Foswiki::Func::normalizeWebTopicName( undef, $topic ); 540 _lazyInit( $web, $topic );538 lazyInit( $web, $topic ); 541 539 _updateSingleAction( $web, $topic, $query->param('uid'), 542 540 $query->param('field') => $query->param('value') ); -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/Action.pm
r5434 r6167 40 40 use integer; 41 41 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;42 use CGI (); 43 use Text::Soundex (); 44 use Time::ParseDate (); 45 46 use Foswiki::Func (); 47 use Foswiki::Attrs (); 48 49 use Foswiki::Plugins::ActionTrackerPlugin::AttrDef (); 50 use Foswiki::Plugins::ActionTrackerPlugin::Format (); 51 51 52 52 our $now = time(); … … 227 227 $defs =~ s/^\s*\|//o; 228 228 $defs =~ s/\|\s*$//o; 229 229 230 foreach my $def ( split( /\s*\|\s*/, $defs ) ) { 230 231 if ( $def =~ m/^\s*(\w+)\s*,\s*(\w+)\s*(,\s*(\d+)\s*)?(,\s*(.*))?$/o ) { … … 625 626 my $class = ref($this); 626 627 if ( defined( &{ $class . "::_matchField_$attrName" } ) ) { 627 628 628 # function match 629 629 my $fn = "_matchField_$attrName"; … … 643 643 && defined( $this->{$attrName} ) ) 644 644 { 645 646 645 # re match 647 646 my $r; -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionNotify.pm
r2987 r6167 25 25 use locale; 26 26 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; 27 use Time::ParseDate (); 28 use Foswiki::Net (); 29 use Foswiki::Attrs (); 30 use Foswiki::Plugins::ActionTrackerPlugin (); 36 31 37 32 my $wikiWordRE; 38 33 my $options; 39 34 40 require Foswiki::Plugins::ActionTrackerPlugin::Options;41 42 35 # PUBLIC actionnotify script entry point. Reinitialises Foswiki. 43 36 # … … 52 45 # Assign SESSION so that Func methods work 53 46 $Foswiki::Plugins::SESSION = $session; 47 48 Foswiki::Plugins::ActionTrackerPlugin::lazyInit($session->{webName}, $session->{topicName}); 54 49 55 50 if ( $expr =~ s/DEBUG//o ) { -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/ActionSet.pm
r6103 r6167 305 305 306 306 foreach my $topic ( keys %$grep ) { 307 308 307 # SMELL: always read the text, because it's faster in the current 309 308 # impl to find the perms embedded in it -
trunk/ActionTrackerPlugin/lib/Foswiki/Plugins/ActionTrackerPlugin/Format.pm
r5434 r6167 32 32 use integer; 33 33 34 require Foswiki::Func;34 use Foswiki::Func (); 35 35 36 36 # PUBLIC Constructor -
trunk/ActionTrackerPlugin/templates/edit.action.tmpl
r2241 r6167 1 %TMPL:INCLUDE{" foswiki"}%1 %TMPL:INCLUDE{"edit"}% 2 2 %TMPL:DEF{"copyright"}%%TMPL:END% 3 %TMPL:DEF{" main"}%3 %TMPL:DEF{"content"}% 4 4 %UNENCODED_TEXT% 5 5 %TMPL:END%
Note: See TracChangeset
for help on using the changeset viewer.
