[pmwiki-users] Simple forms, but which processor?

Mark Bacas mbacas at gmail.com
Sun Feb 28 08:16:18 CST 2010

I wonder if it is the "newticket" function (powertools.php) that is
taking me straight to the edit form? Is it possible that I need to
change this?

# add markup expression {(newticket Group)}
# creates auto increasing pagename of format
# Group.20061220001 (date and 3 digit number)
$MarkupExpr['newticket'] = 'MakeNewTicket($pagename, $args[0])';
function MakeNewTicket($pagename, $grp) {
   if (!$grp) $grp = PageVar($pagename, '$Group');
   foreach(ListPages("/^$grp.\\d{11}/") as $p)
       $issue = max(@$issue,substr($p,-11));
   $issueday = substr($issue,0,8);
   $today = strftime("%Y%m%d", time());
   if($issueday==$today) {
      $nextissue = $issue+1;
      $target = $grp.".".$nextissue;
   else $target = $grp.".".$today."001";
   return $target;


 - Mark

On Fri, Feb 26, 2010 at 12:23 PM, DaveG <pmwiki at solidgone.com> wrote:
>> On Thu, Feb 25, 2010 at 2:48 PM, Mark Bacas<mbacas at gmail.com>  wrote:
>>> So, I'd like to have a button or link I click on which creates a
>>> newticket (powertools) that brings me to a form that I fill out. The
>>> form would have some PTV that I can key off of for my pagelist
>>> process. I think I was almost there with PmForm but I came to the edit
>>> screen first which I had to Save first and then I'd see the form to
>>> fill out. I just want to be brought straight to the form.
> There are a couple of pages on PmWiki around PmForm. The main one is
> http://www.pmwiki.org/pmform/, and this has links to a few examples. I know
> I missed this when I started, so just pointing it out.
> That is possible with PmForm -- you should need to goto the edit page. Are
> you able to post an example of what you are doing, or a URL? When you define
> the $PmForm you need to specify the 'saveto' parameter.
>>> Also when I
>>> have my list of pages processed by pagelist I'd like to be able to
>>> click on a link that would bring up the form to allow me to edit/add
>>> new data to the existing form.
> The easiest way is to have the pmform directive as part of the page group
> header. So with the PmForm variables forming the content of the page, the
> header now uses those variables to pre-populate the form. So the group
> header would be:
> (:pmform my-form:)
>  ~ ~ Dave

More information about the pmwiki-users mailing list