You would also need to change code line 346 to reflect the number of digits:

$issue = max(@$issue,substr($p,-11));

for a five digit suffix to the day number change to

$issue = max(@$issue,substr($p,-13));

i.e. the page names consists now of numbers with 13 digits (8 for the day-number plus 5 for the suffix).Because of such complications I will not change the recipe to incorporate a 'suffix' global variable. - HansB December 04, 2017, at 05:53 PM

Indeed, there are additional additional modifications, but they are fairly straightforward—here is the full modified function:

So, we calculate the number of digits based on the length of the suffix, as you can see.

I have also modified the regex that filters page names a bit, to compensate for a bug I stumbled on, that breaks the incrementing if there exist pages with a name like 20061220001-Talk (if e.g. you have implemented Talk pages, as I have done); the modification eliminates that bug.

inside the function though, there is no need to define the suffix if the functionis not called. One other thing may be good too, which is to make sure any $PowerToolsNewTicketSuffix set is an integer, not just any string. - HansB December 05, 2017, at 03:18 AM

Although the docs for pagelist say Any PageList directive parameters are allowed, quotation marks surrounding included and excluded text are not working for me. This would allow the searching for words with spaces in them, or arbitrary sections of text containing punctuation.

For example, I can use standard pmwiki pagelist markup so:

(:pagelist "TODO:":) or (:pagelist TODO::) and obtain results

but

{(pagelist TODO:)} or {(pagelist "TODO:")} or {(pagelist 'TODO:')} or even {(pagelist "'TODO:'")} (single-quotes-in-double-quotes, as suggested below) are return no results.

Is there a parameter name or markup trick that I am missing?

I was hoping to pipe the output to TextExtract, but that only takes input from {(pagelist)} and not (:pagelist:), it seems.

I am using (:pagelist "TODO:" fmt=extract unit=line phead=link order=-time:) right now, which provides roughly what I was looking for, but I'm curious as to why I was failing with the {(pagelist)} markup.

Please leave latest comment/request at the top

pagelist doesn't find records when PTV value used in selection has a space

AllanGN 2012-06-07: Using a PTV as part of the pagelist selection, it seems to fail when the PTV value has a space.

Some background: I'm using Pmwiki to manage my "todos" using pages I'm calling Notes, and I assign PTVs to each one including "notestatus" (which has values like "Open", "Completed", "In progress") and "notehoursleft" (hours of work left for a particular Note). I'm trying to use PowerTools' sumdata and pagelist to selectively add up "notehoursleft".

Anyway, here are some of my test findings, below.

(p.s. Thanks for all this. I've just recently started using Fox (I love FoxEdit!) and now trying these PowerTools. Fantastic stuff.)

These work:
Hard-coded "Open":
Notes.Note-0022
Hard-coded: "Open,Cancelled":
Notes.Note-0014,Notes.Note-0015,Notes.Note-0022,Notes.Note-0030,Notes.Note-0035,Notes.Note-0044,Notes.Note-0052,Notes.Note-0061,Notes.Note-0074
Using a temporary PTV:
testnotestatus = Open,Cancelled
Notes.Note-0014,Notes.Note-0015,Notes.Note-0022,Notes.Note-0030,Notes.Note-0035,Notes.Note-0044,Notes.Note-0052,Notes.Note-0061,Notes.Note-0074
These fail:
Hard-coded: "In progress". (I think it doesn't work because there's a space?)
Using a temporary PTV, one of the values has a space:
testnotestatus2 = Open,In progress

Thanks, confirmed as a bug, and I don't know a solution at present. If you use the pagelist markup expression solo, i.e. similar to a directive, and not nested in other markup expressions or directives, you could avoid the problem by using the (:pagelist ... :) directive, with your parameters, plus the additional parameter fmt=csv, which you got defined by including powertools.php. I.e. like (:pagelist group=Notes name=Note-* $:notestatus="In progress" fmt=csv:)HansB June 08, 2012, at 11:27 AM

PS:Just discovered you can use values with spaces by adding another pair of quotes (single quotes in double quotes), like {(pagelist group=Notes name=Note-* $:notestatus="'In progress'" )}

I went with your "single quotes in double quotes" tip; that did the trick. I used FoxTextReplace to change back my note status types to having spaces in the middle. All working! Thanks! AllanGN, 2012-06-12 (p.s. FoxTextReplace = wow)

(serial) issue when appending digits

DannyB 2012-02-23: I use the 2 digit year number as a prefix for the serial command. At the beginning of every year when the prefix changes the serial command does not produce the correct "next" number because the code looks for digits. I modified the code as follows and the role-over now works because my year digits don't get "eaten up" by the regular expression. I also tried a second approach using substr (the other commented out line) to just skip the leading stuff producing a variable rather than an array and it worked too. If you feel that this general approach fixes the problem without breaking something else, could you produce an update for the serial and serialname commands so I don't have to worry about patching the code?

(trail) question

Is it possible for the "label" to return the title or name of the page the prev/next link is going to?
Sovvie December 14, 2011, at 08:12 AM

Installation

I'm assuming that installation of PowerTools is the same as for other recipes: "place powertools.php in your cookbook folder and add include_once('cookbook/powertools.php'); to your local/config.php" although this instruction is not included on the recipe description page. R D Jones August 25, 2011, at 08:12 AM

(serialname) issue

DannyB 2011-03-08: I just want to create a serial pagename starting with the current 2 digit year on the front. Why won't this work?

It gives me the pagename "SerialnameProjects11". Does it just not process the "serialname" function? I'm ready to write my own "serialyear" function, but really want this to work.

HansB: Instead of using a markup expression as value for a page text variable, and using the PTV inside a markup expression, use the time markup expression directly inside the serialname expression:[[{(serialname Projects (ftime fmt=%y) )}?action=edit|New Project]]

Mark Bacas - 20100301 - I'm trying to make use of "newticket" for creating new forms. I would like to be brought to the "Form" and not the "Edit" page where I have to click "Save" to get to the form. Is there something special I have to do to skip the "Edit" page? I believe all of my form stuff is setup properly (but maybe I'm missing something there).

HansB: sounds like a form, not a 'newticket' issue. I would need to see how your form is set up. Can this be discussed on PmWiki's user mail list, or on a Talk page of the form processing recipe you use?

(pagelist) issue and proposed fix

SteP 2010-12-04: I noticed some cases where (pagelist) produces different results than the regular (:pagelist:) markup. I couldn't get some nested markup expressions to work correctly inside (pagelist). Then I found a fix, by replacing one line in powertools.php, from:

As scripts/markupexpr.php explains, when $params is used ParseArgs() returns possibly escaped values, which can be unescaped before passing them to FmtPageList(). This fix works for me. If more people can test it and find it OK, it could be rolled into the next revision.

I expected the following 2 pagelists to be identical except for the different default fmt=X: