WikiFormsFeatureRequests

Summary: Feature requests for the WikiForms recipe
Categories: Forms

WikiForms Feature Requests

Feature requests for the WikiForms recipe

Inclusion of static text / markup in Forms?

Thanks for all the work! WikiForms is indeed a great add-on. I’d like to include something like the following on each page generated by a form to allow adding attachments and displaying a list of the attachments. (I’ve set up uploads in the “by group – by page” mode.) It would also be useful to be able to put "boilerplate" on each form-generated page. Clayton Curtis April 19, 2006, at 09:03 AM

[[{$FullName}?action=upload | Click here]] to upload file to attach to this page.
(:if attachments)
(:attachlist:)
(:if:)

I'd like to second Clayton's proposal that you work out a way to include static markup on the generated pages. Scott Connard May 28, 2006, at 07:22 PM

I suggest using a GroupFooter page and add (:nogroupfooter:) directives to any non-form-based pages. This is the standard PmWiki way to put boilerplate text on pages and AFAIK the forms script shouldn't get in the way at all. jr

If I use the GroupFooter, the files are attached to the FormTemplate, and not to the newly created page. I think what we are asking for is a way for users to upload files when they create the page via form, and have the file available for download via the page that is created? GB June 1, 2006

You have to upload the file after the page is created. Put (:nogroupfooter:) on the FormTemplate page, so people aren't tempted to upload files to that page. Then after filling in a form, pressing submit and saving the new page, use an Upload file link from the group footer. The GroupFooter would include the following text, or something like it:
[[{$FullName}?action=upload | Upload file]] to attach to this page.
(:if attachments)
(:attachlist:)
(:if:)

Alternatively, put Attach:filename.ext into a form field. Then once the page is created, click the filename link to upload the file. Is there a link where we can see and test this issue? jr

Or, use the ViewTemplate feature described below and include your static text and/or the above upload/attachlist markup into the ViewTemplate. This also allows you to upload a file after creating the page. Scott Connard

Multiple forms for the same dataset or Wiki Content in Forms?

First off - WikiForms is a great add-on for a great Wiki Implementation.

We're trying to use WikiForms as a technical-support-request system, similar to PITS, etc. I'd like to have anyone be able to submit a request, but limit specific fields to our IS Dept.

  • Ideally, there would be 2 forms for the same page, each displaying only certain fields. I know field limiting is possible with the hidden field type, but I can't figure out how to have 2 forms available to the same group.
  • Less Ideally, I'd like to have something like:

    The following fields are for IS Dept only:

    appear in the middle of the form, but the when the form template is transformed, any non-form-field wiki content seems to get dropped. Is there a workaround? I'm sure I'm not the only one who sees the advantage in having forms where fields are interspersed with longer directions, comments, or headers.

James F Mason

The author hasn't thought of a good way to do this as yet.
I've tweaked the WikiForms to put a hidden form field with a html tag in it (bad, I know, but it won't take a space or anything that doesn't show up). Then it will not show anything in the field column and you can write anything to the header. And also, if you dare to use regular html tagging, you can format the hidden field header with a <b> or <em> tagging and css.

--LasseS

Customize the Issue Page Format

It would be very useful to allow the user specify the format of the resulting page. I think the format of dl/dt/dd may not be the appropriate for many purposes. So, the user could write a template page (say, $Group/ResultTemplate) where one can insert the fields of the form by using an appropriate markup (i.e. $Form.<field-name>)(GC)

A proof of concept has been added in version 1.0.45. Create a page called ViewTemplate in the group holding the data. On this page, you can refer to a field value by writing <fieldname> -- on browse, the recipe will substitute the actual value. To change the template, add ?template=templatename to the url. Make sure you use the <fieldname> ,not the <prompt text>. jr

Idea: WikiForms light

It just occurred to me that in several applications, a "WikiForms light" would be sufficient:

  • Instead of generating n pages to dynamically generate a table with n lines, it would suffice to just add 1 line at a time to a static table with n lines. This would be similar to a form-based CommentBox.

This appears light-weight yet powerful from both the administrator's and the users' perspective, so I'd like to suggest its inclusion (hoping that it's simple to implement, too :-) --Henning April 10, 2006, at 09:54 AM

Add the "upload" form control

First of all, congratulations to the author for his hard work.

For our needs we would like to have an "upload file" control (the normal one with a text box for the filename and an upload button). The uploaded file should be added directly to the attachments list of the resulting page. Is this planned, or can it be done by some other means?

See Inclusion of static text / markup in Forms? above.

Submit button to skip edit page and save directly?

Is it possible to make the Submit button skip the edit page and save directly instead?

(I figure it's not possible yet, so I guess this is a feature request.) --Henning May 04, 2006, at 03:12 AM

It's not only possible, it's easy... In local/config.php, before the line that includes the wikiform script, add the following:
        $WikiFormSubmit = 'post';

Thanks! It seems that would change groups with Wikiforms to the new behaviour, though? I'd like to leave the existing 3 or 4 applications as they are now, and only use the 'post' setup in one specific group. (I tried to control that by re-including Wikiforms in the group config file, but it seems that yields a standard preview.) --Henning May 08, 2006, at 07:45 AM

Correct. What we need is a way for a Group.php file to detect that a form post request is happening and set the appropriate $_POST values. At the moment, by the time pmwiki reaches the Group.php file, it thinks that a regular edit action is happening. Alternatively, we need a way to specify the desired behaviour (save or preview) in the form template. Let me see what I can come up with. jr
A test... Install wikiformtest.phpΔ (comment out the existing include wikiform statement) and add the following to the form template controlling the group where the 'post' setup is wanted:
        (:submit post:)
On the other hand, if local/config.php has set $WikiFormSubmit = 'post'; you can override this for a particular group by adding the following to the form template:
        (:submit preview:)
A submit directive will override the configuration settings. This is a test version -- please report any problems encountered. Configuring this through the template seemed the most flexible solution. jr May 28, 2006, at 06:07 PM

P.S. What happens if I have enabled AuthorRequired and the author has not yet entered his name? (Guess I'll have to disable AuthorRequired in that group.) --Henning May 09, 2006, at 07:21 AM

If Author is required and author is blank, pmwiki will reject the save request and display the normal edit form with an Author Required message (I think). jr

Thanks! :-) The test version works fine. I noticed a different table style and an indication of the list length, but I suppose these are intentional changes. I'm quite happy with the new version! :-) --Henning May 30, 2006, at 11:51 AM

Absolute attachment links in wikiform table?

I hope it doesn't look like I'm feature-greedy ;-\ One thing I'd really like to have would be attachment links that work even with "uploads per page" and if the wikiform table is called from another group. Currently, the links are not functional so that attachments can only be called from the page, which makes the overview table less useful than it might be. Any way this would be possible? Thanks again! --Henning May 30, 2006, at 11:51 AM <- Feature Request Monster :-/

Some people are never satisfied... This might be a PmWiki issue; I need to think about it. Is there a site I can look at?

I'm afraid my site is only accessible through our corporate intranet :-( Lacking a "live demonstration", I'll try to describe the problem:

  1. Using per-page upload, the download URL is: http://.../pmwiki/pmwiki.php/Audit-Monitor/00001?action=download&upname=Auditreport.doc
  2. In the wikilist called from another page (even in the same group), the downlaod URL is given as: http://.../pmwiki/pmwiki.php/Audit-Monitor/Certain-Audits?action=upload&upname=Auditreport.doc

So in case 2, the links don't work. This limits the usefullness of the wikilist as you can't just browse the reports by clicking the links in the attachment fields but have to navigate through each individual page in the group. (Using per-group uploads would of course eliminate the problem, but at the price of burdening the user with "manually" finding a unique name for each uploaded file.) --Henning June 12, 2006, at 10:10 AM

Conceptually (meaning "in theory, this should work") you need something like this:
  1. define a new markup rule for the Audit-Monitor.Certain-Audits page
  2. this rule needs to evaluate after the wikilist rule and before the Attach rule
  3. it needs to extract from a wikilist table row the group and 5 digit page number, the attach and the file name; it would be nice if these were in adjacent cells
  4. the markup rule turns Attach:filename into Monster:group/ddddd/filename
  5. a new $LinkFunctions['Monster:'] gets group.ddddd from the group/ddddd/filename and calls LinkUpload with this as the pagename
  6. and that should do it... just a few implementation details to sort out
Does that make any kind of sense? jr

Without knowing the inner workings of PmWiki, I'd say it makes sense. However, #1 might be difficult because there are many pages that aggregate information from the wikilists, and new ones might be written by normal authors anytime. If each of them requires setting up a new markup rule, that might be problematic. (By the way, there can be several attachments per page, possibly in different fields, and mixed with normal markup. Would that work with your suggested method?)

The best bet is probably to redefine the wikilist markup rule as
      Markup('wlist','directives','/^\(:wikilist\s*(.*?):\)/e',
    "'<:block>'.MonsterFmtEntryList('',\$pagename,array('q'=>PSS('$1')))");
The first thing MonsterFmtEntryList does is call FmtEntryList. The multiple attachments just changes the subsequent logic. Grab the entire table that's generated from the FmtEntryList, then for each <tr>(.*?)</tr> extract the page number, all the Attach file references, and proceed as before. Unfortunately, there is no such thing as a free lunch!
Though I don't understand the code, I think it should work :-) One thought: What about qualified attach links ("To link to attachments on another page or WikiGroup, use Attach:PageName/file.ext or Attach:Group.PageName/file.ext.")that link a file from another page? I haven't been able to make them work anyway (perhaps because of a misunderstanding of the concept), but I believe they would have to be excepted from a substitution. --Henning June 19, 2006, at 09:43 AM

It just occurred to me to check out how the "include" directive handles attachments, and found that it works the same way as WikiForms, so maybe it's a PmWiki thing after all? I'd imagine both ways of including a page would be valid applications: Either as template to be filled with calling-page specific uploads, or as faithful reproduction of repetitive information where only one instance of an attachment exists. Include Other Pages notes the directive is implemented as a "straight text inclusion", yielding the former application but not the latter. --Henning June 13, 2006, at 06:52 AM

More than one digit for scores?

Will it be possible to have more than one digit in the values? this will allow price calculation
:price:price (110;120;150;170) 0+
Isidor
In principle yes, but I have to work out how to handle leading zeros first -- at the moment it correctly sorts values from 00 to 99.
I solved this by extending the sort algorithm to handle numerical sorting and thus the need for zero padding. --MSB

How to select empty fields?

After having generated loads of useful lists with the improved list selection criteria (thanks again!), I have now discovered that occasionally, I need to filter lists so that the pages are listed that have no data in a specific field. Is there any way to do that? =, ='' and ="" appear unsuitable for this. --Henning July 14, 2006, at 02:08 PM

Possible Prompt/Variable Name Confusion Issue

There seems to be an undesired interference between prompt and variable name. I just changed a prompt, and while the field was still displayed in a list as specified (it wasn't in the default list), no content was shown for the field.

Apparently the content is referenced by the prompt (which is stored on the issue page) and not by the variable name (which isn't stored). This makes it impossible to change prompts without changing all existing issue pages at the same time.

Maybe more flexibility could be achieved by ...

  1. recognizing fields by their position on the page (simple, but vulnerable against addition of new fields), or
  2. recognizing fields by their variable names which are stored using the markup for internal anchors (more complicated).
  3. or possibly we detect that the prompt on the page is different from the prompt on the template and highlight this somehow... For example, if the template has a prompt of 'Subject' and we edit a page with the old prompt of 'Category', the form comes up with 'Subject (Category)'; once the page is saved, this will of course go away -- added to version 1.25 jr
This is a good feature and solves half of my problem :-) The other half is that when I intoduce a new field somewhere in the middle of the form template, each subsequent field n on the existing pages will be read as field n-1. That means I can only add fields at the end of the form (unless I edit all existing pages to match the new template), and that often is not the desired position. --Henning September 28, 2005, at 11:52 AM

Random number generator

WikiForms uses sequential numbers for newly created forms. This will have a HUGE impact on all forms when only 1 form accidentily get's messed up. All following WikiForms will be effected, making it useless or even worse, cause damage to the trust of the information provided by the wiki. Anybody have any thoughts on this? hfwang sep032006

Hm, what do you mean by "messed up"? My experience is that if you accidentally damage one page, no other pages are affected. Only when you edit the FormTemplate page, the rest of the pages will appear to be affected. I'd recommend write-protecting the FormTemplate page if you fear accidental edits. --Henning September 04, 2006, at 05
15 AM

Saving the information in a seperate file

I would like to save the information of the wikiform also in a seperate csv file. Is there a way to do this?

As long as you avoid the use of line breaks on the individual pages, it's possible to do a manual copy & paste to port the data to a different program. (You might have to build a special wikiform directive to include all columns if the default column selection shows only part of the columns.) I'm not aware of any automatical features for the export of data, though. --Henning November 09, 2006, at 11:00 AM

Locking forms under certain criteria, and email links

I'm using WikiForms as an issue-tracking system, and while it's working perfectly there's two things I'd like to request. Firstly, a way to specify a criteria (for example, an issue being marked as 'closed') which removes the edit form link from the read page. Secondly, a way to have an email link that changes depending upon the author's name.

Define the maximum number of items to display

I am not sure if the maximum number of items can be defined. For example when there are over 100 items existed, the users have to scroll down and up to search the whole table. Can all items be displayed by defined number per page? --Barton June 08, 2007, at 21:22

Bill of Material (BOM)

I am trying to design a project managament system wich will all documentation from wikiform it's going great. The thing is that I have another wikiform for Parts or parts in stock. After a project is created I would like to insert through wikilist a BOM from Items of parts wikiforms. I can manage to do so but in my project I would like to asign extra fields to that BOM like Reference and Qty (EX:R1,C2,R3...20,24 , etc). The parts wikiform do not have this fields and besides any parts can be used in multi projects at the same time with differnt quntities for each project. I am not sure how to do this yet. --Marte September 30, 2007, at 10:39

Formatting of forms

I would like to be able to format the forms for data entry with greater flexibility. At a minimum I would like to be able to put in titles to divide the form up into sections. Ideally I would be able to use tables and etc. as well. --PeterBowers October 22, 2007

Anchored selection on pagelist

I would like the capability to "anchor" a substring search in the wikilist markup. In other words (ala regex) e$ matches an e only at the end of a word, etc. Otherwise it is difficult to differentiate between "Book" and "Booklet", for instance. --PeterBowers October 22, 2007

Data validation

Ideally there would be some regexp validation or the like. In absence of that could there at least be some markup that indicates that this is a required field? It could perhaps have a "+" prepended to the variable name or something and then those prompts would be automatically bolded and the submission would be ineffective until those fields were filled in. --PeterBowers October 22, 2007

Variable names to include special characters

It would be nice if at least underscores were allowed in variable names. Currently including an underscore in a variable name appears to mess up the whole form. (Update 10/25/2007: It appears that uppercase letters in variable names cause problem with selection using (:wikilist VariableName=Value:) -- I guess the "special characters" in this request should also include uppercase letters.) --PeterBowers October 22, 2007

Comments after fields should either allow markup or totally ignore all markup

Currently in the double-colon comments if you include a colon as part of your text then the form starts processing another field. --PeterBowers October 22, 2007

Allow for insertion of a field in the middle of a form

Currently inserting a field in the FormTemplate causes all subsequent fields on existing data to be off by 1. In other words if I had fields a, b, and c with values of a=1, b=2, and c=3 respectively. Then I add a field "n" between a and b (now a, n, b, c) then my variables will contain these values: a=1, n=2, b=3, c=blank. The prompts are somewhat helpful (they put the old prompt in parentheses) but the offset business is quite difficult. --PeterBowers October 22, 2007

List remains re-sortable despite sort order specification in wikilist statement?

It would be nice if the wikilist could be re-sorted by clicking on the field headings even if there is a specific sort order defined in the wikiform statement. I believe that if the specification is considered the default sort order which can be overridden by clicking on the field headings, this would be possible without any "logical knot". --Henning February 01, 2008, at 05:55 AM

Fuller documentation

I just found out (via jr post to pmwiki-users) that if you put a !!! header on a linked page then that header will become a tooltip for that link. Or at least for profile links. Are there other undocumented "gems" out there like this? I've just searched through the documentation pretty carefully searching for any mention of this and I didn't find it.

Page names

Is there an option to specify a page name instead of the sequential pages this cookbook creates? for example it would be great on the template page if i could have a field that promts the user to specify a page name. this would then allow (:dictindex:) to pick up the name of the page rather than the sequential numbers. as a temporary fix i added a searchbox at the top of the page with the (:wikilist:) to search for the server name - but it's not ideal. great script btw!

More forms in one group

Is it possible to expand the script so that it recognizes more than one form template? For instance by writing the relevant form template page name in the wikiform and wikilist directives? (Great script, which I have used for several years.) HugoAlroe December 09, 2008, at 06:24 AM

Limit the size of the lists

Is it possible to limite the size of the lists generate with the wikilist directives ? See the "count" option in the "pagelist" directive.