[pmwiki-users] Upgrade Form (Zap) to New Input Mark up

Sivakatirswami katir at hindu.org
Fri May 25 06:47:48 CDT 2007


I need some help upgrading a ZAP form...
which now uses the new PM input mark up.

Simple select fields are easy, but I'm having trouble with conditionals 
as well as
calling a page list into the select drop down menu of one of the fields
  These worked fine before, but I am unable to get find the syntax now
to do what worked before. Can anyone help?

------------------------------
(:zapdata:
(:zapform:)

# the following field  is broken, I don't know how to re-write it:
# Here we are dealing with a conditional default
# the user does not set anything...
# the default is either an existing page variable  if it is in the
# group "TODO*   OR it takes the value of the current group

Project:
(:input default Project :)
(:if group TODO*:)(: value='{$:Project}':)
(:if ! group TODO*:)(:value='{$Group}':){$Group}
(:ifend:)

#### old working, code was  #######

Project:
(:select Project:) (:if group TODO*:)(:option value="{$Project}":) 
{$Project}(:if ! group TODO*:)(:option value="{$Group}":){$Group}(:ifend:)
(:selectend:)

###############

# the following is also not working and i also don't know to rewrite
# have tried various options, but none will work:
# it previously supplied a page list of names from group "Team"
# i.e. a list of staff persons, each of whom has their own page
# in Team.Andre   Team.Dharma  etc.  in the select dropdown
# we would get  "Andre, Dharma  etc." to choose from as the input value

Owner:
(:input default Owner '{$Owner}':)
(:input select Owner '(:pagelist group=Team name=-RecentChanges 
fmt="#selectPages":)':)

#### old code that worked fine, very simply:  #######
Owner:
(:select Owner:) (:option "{$Owner}":) {$Owner}
(:pagelist group=Team name=-RecentChanges fmt="#selectPages":)
(:selectend:)
##############

#The following works... this is easy:
Priority:
(:input default Priority '{$:Priority}':)
(:input select Priority '1-Top':)
(:input select Priority '2-Hi':)
(:input select Priority '3-Med':)
(:input select Priority '4-Lo':)
(:input select Priority '5-Done':)

Status:
(:input default Status '{$:Status}':)
(:input select Status 'Open':)
(:input select Status 'In Progress':)
(:input select Status 'Pending':)
(:input select Status 'Hold':)
(:input select Status 'Complete':)
(:input select Status 'Cancelled':)


# have yet to test if the following will work or not.

(:if group TODO*:)
Description: (:input text Description "{$Description}" size=75:)

(:if group -TODO*:)
Description:
(:input textarea Description "{$Description}" rows=7 cols=15:)

# have yet to test if the following will work or not.

(:if ! group TODO*:)
(:zap datapage="TODO-{Project}.#":)
(:input hidden returnpage "{$FullName}":)
(:if group TODO*:)
(:input hidden returnpage "{$returnpage}":)
(:ifend:)
(:input hidden savedata 
"Project,Owner,Priority,Status,Description,returnpage":) (:input submit 
value="Submit":)(:zapend:)
(:messages:)
-- 
Om shanti
(In  Peace)

Sivakatirswami
www.himalayanacademy.com

Get Hinduism Today Digital Edition. It's Free!
http://www.hinduismtoday.com/digital/



More information about the pmwiki-users mailing list