This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
zref:wiki:pluginsyntax:bureaucracy [2025/04/22 13:44] – removed - external edit (Unknown date) 127.0.0.1 | zref:wiki:pluginsyntax:bureaucracy [2025/04/22 13:44] (current) – ↷ Page moved from wiki:pluginsyntax:bureaucracy to zref:wiki:pluginsyntax:bureaucracy Alan Shea | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Bureaucracy Plugin ====== | ||
+ | The [[doku> | ||
+ | |||
+ | ==== Recommended additional Plugins ==== | ||
+ | |||
+ | On an open wiki, you might want to use the [[doku> | ||
+ | |||
+ | The [[doku> | ||
+ | |||
+ | When you use Bureaucracy' | ||
+ | |||
+ | The recent [[doku> | ||
+ | |||
+ | === Additional Actions === | ||
+ | |||
+ | An additional plugin to look at is [[pagemod]], | ||
+ | |||
+ | === Additional Fields === | ||
+ | |||
+ | The [[doku> | ||
+ | |||
+ | With [[doku> | ||
+ | |||
+ | ==== Warning ==== | ||
+ | |||
+ | Without the CAPTCHA, this plugin should only be used on closed wikis, because it could easily be abused as a spam gateway. | ||
+ | |||
+ | ===== Usage ===== | ||
+ | |||
+ | Let's start with an example: | ||
+ | |||
+ | |||
+ | {{ bureaucracy.png? | ||
+ | |||
+ | |||
+ | < | ||
+ | < | ||
+ | Action mail me@example.com | ||
+ | Thanks " | ||
+ | |||
+ | Fieldset "A set of fields" | ||
+ | Textbox | ||
+ | number "Your Age" >13 <99 | ||
+ | email "Your E-Mail Address" | ||
+ | textbox " | ||
+ | password "Some password" | ||
+ | |||
+ | fieldset "even more fields" | ||
+ | select " | ||
+ | static "Some static text that could be an agreement" | ||
+ | yesno "Read the agreement?" | ||
+ | textarea "Tell me about your self" | ||
+ | textbox "You need to write ' | ||
+ | submit " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | As you can see, you can define a email address where the data should be sent to and a thank you text to be shown when a user submitted the form. What follows are the various fields to fill in. | ||
+ | |||
+ | ==== Field definitions ==== | ||
+ | |||
+ | * Fields are defined by giving a type and a label. | ||
+ | * For '' | ||
+ | * Some fields, like the '' | ||
+ | * Additional constraints can be added after the main options. | ||
+ | |||
+ | * Arguments need to be wrapped in double quotes when they contain spaces e.g. '' | ||
+ | * Including a '' | ||
+ | |||
+ | The plugin takes care of validating the form, the field types, and set constraints. | ||
+ | |||
+ | ==== Fields ==== | ||
+ | |||
+ | * **action** | ||
+ | * The first parameter needs to be a supported action (see [[#action modes|below]]).\\ Currently supported are '' | ||
+ | * Additional parameters for type '' | ||
+ | * one or more email addresses to send the data to (required) | ||
+ | * Additional parameters for type '' | ||
+ | * name of a page or namespace (trailing colon) to use as template or a single underscore '' | ||
+ | * namespace: | ||
+ | * separator to use when combining multiple fields into the pagename (optional) | ||
+ | * Additional parameters for type '' | ||
+ | * the name of the script-file in the '' | ||
+ | * Multiple actions can be defined by adding another action field | ||
+ | * **thanks** | ||
+ | * define a text to be displayed when the form was submitted. (optional) | ||
+ | * **fieldset** | ||
+ | * creates a new set of fields | ||
+ | * a label is optional | ||
+ | * Can be shown/ | ||
+ | * Switching depends on the field given as second parameter (optional) | ||
+ | * Fieldset is displayed as that field is set\\ or has an exact match with the value given as third parameter (optional) | ||
+ | * **static** | ||
+ | * adds some static text to the form | ||
+ | * **wiki** | ||
+ | * similar to static, but parses the input as Wiki syntax | ||
+ | * should be used sparsely as it is computationally expensive | ||
+ | * **textbox** | ||
+ | * creates a single line input field | ||
+ | * needs a label | ||
+ | * **password** | ||
+ | * creates a single line password input field | ||
+ | * needs a label | ||
+ | * **email** | ||
+ | * creates a single line input field | ||
+ | * needs a label | ||
+ | * the input is validated to be a valid email address | ||
+ | * argument '' | ||
+ | * **[[# | ||
+ | * creates a single line input field | ||
+ | * needs a label | ||
+ | * the input is validated to be numeric | ||
+ | * can be pre-filled with auto-incrementing number, see [[# | ||
+ | * **textarea** | ||
+ | * creates a multi-line input field | ||
+ | * needs a label | ||
+ | * to change the default size of 10 rows to **//N//** rows, use the argument x**//N//** ('' | ||
+ | * **[[# | ||
+ | * creates a checkbox | ||
+ | * needs a label | ||
+ | * needs default values for yes and no ('' | ||
+ | * **select** | ||
+ | * creates a dropdown list | ||
+ | * needs a label | ||
+ | * needs a second argument containing the select options separated by a pipe '' | ||
+ | * **multiselect** | ||
+ | * you can select multiple values | ||
+ | * needs a label | ||
+ | * needs a second argument containing the select options separated by a pipe '' | ||
+ | * example: '' | ||
+ | * In mail action: all options will be joined by "'', | ||
+ | * In template action: | ||
+ | * if field is marked with " | ||
+ | * during template substitution all options will be joined by "'', | ||
+ | * **radio** | ||
+ | * creates a set of radiobuttons | ||
+ | * needs a label | ||
+ | * needs a second argument containing the radio options separated by a pipe '' | ||
+ | * **hidden** | ||
+ | * creates an invisible field with static data | ||
+ | * needs a label | ||
+ | * needs a default value parameter ('' | ||
+ | * **hiddenautoinc** | ||
+ | * needs a label | ||
+ | * creates an invisible field with a number that increases by 1 on each form submit | ||
+ | * **submit** | ||
+ | * creates a submit button (required) | ||
+ | * a button label is optional | ||
+ | * **user / users** | ||
+ | * a DokuWiki user or list of DokuWiki users | ||
+ | * needs a label | ||
+ | * provides autocompletion | ||
+ | * **date** | ||
+ | * a date in the format YYYY-MM-DD | ||
+ | * needs a label | ||
+ | * provides a date picker | ||
+ | * **time** | ||
+ | * a time in the format (H)H: | ||
+ | * needs a label | ||
+ | * **usemailtemplate** template_id | ||
+ | * the content of the '' | ||
+ | * template_id is absolute or relative pageid. If relative, it is solved against the pageid of the form | ||
+ | * **addpage** page_tpl page_tgt | ||
+ | * adds another page '' | ||
+ | * only for use with the template action | ||
+ | * if page_tpl is absolute or relative pageid. If relative, it is solved against the pageid of the form | ||
+ | * page_tgt is relative to destination of page created by action field. e.g. action field tries to create '' | ||
+ | * When in the '' | ||
+ | * **labels** | ||
+ | * parameter is a wiki page containing a list of label translations | ||
+ | * **file** | ||
+ | * let user select a file for upload (which is added to media by template action, or added as attachment in mail action) | ||
+ | * needs a label | ||
+ | * an optional addition parameter specifies the namespace to which the upload should go to. '' | ||
+ | * **data_aliastextbox** (needs plugin) | ||
+ | * requires [[doku> | ||
+ | * needs a label | ||
+ | * an additional parameter is starting by underscore '' | ||
+ | * datatypes with a type alias that defines 'valid values' | ||
+ | * otherwise it appears as usual textbox, sometimes with [[doku> | ||
+ | * **struct_field** + **struct_fieldhidden** (needs plugin) | ||
+ | * Just specify a field from a defined schema "< | ||
+ | * Label is used from definition as well as validation rules | ||
+ | * See [[doku> | ||
+ | * **struct_schema** (needs plugin) | ||
+ | * Just specify a defined schema "< | ||
+ | * Adds the whole scheme to the form | ||
+ | * See [[doku> | ||
+ | |||
+ | ==== Constraints and Defaults ==== | ||
+ | |||
+ | * Start with a ''>'' | ||
+ | * Start with a ''<'' | ||
+ | * Start with a '' | ||
+ | * Use a single '' | ||
+ | * Use a single '' | ||
+ | * Use a single '' | ||
+ | * Use a double '' | ||
+ | * Use a number of '' | ||
+ | * Use a '' | ||
+ | * Enclose a regular expression with ''/'' | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * Set message for if regular expressions don't match by using '' | ||
+ | * '' | ||
+ | * Only for [[doku> | ||
+ | |||
+ | === A simple guide to Regular Expressions === | ||
+ | |||
+ | A **regular expression** is used to define a pattern of text. In its simplest case (as used here) if the pattern can be found then the text is accepted, if the test fails then the text is rejected. | ||
+ | |||
+ | The simplest possible regular expression (//regex//) is a single character: ''/ | ||
+ | |||
+ | The regex may contain a number of characters: ''/ | ||
+ | |||
+ | Frequently you want to select one of a number of characters. | ||
+ | |||
+ | The brackets are called // | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | * " | ||
+ | |||
+ | For example ''/ | ||
+ | |||
+ | Looking now at the examples above. | ||
+ | |||
+ | Finally ''/ | ||
+ | |||
+ | For more information: | ||
+ | * general tutorial -- http:// | ||
+ | * list of special characters -- https:// | ||
+ | * http:// | ||
+ | |||
+ | ==== External Label Names ==== | ||
+ | |||
+ | By default all labels are used as provided. Eg. they are displayed in the form and they are used as placeholders for the template mode. In some cases you might want to use simpler names for the fields but still have more extensive labels displayed in the form. | ||
+ | |||
+ | This can be achieved with defining label translations in a separate wiki page and give this page in the '' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | action mail me@example.com | ||
+ | labels mylabels | ||
+ | |||
+ | fieldset " | ||
+ | textbox | ||
+ | number | ||
+ | submit | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The translation page needs to contain a single wiki list with items named '' | ||
+ | |||
+ | < | ||
+ | * field = Tell us about yourself" | ||
+ | * name = Your Name | ||
+ | * age = Your Age | ||
+ | * submit = Send your Data | ||
+ | </ | ||
+ | |||
+ | The above would result in the following form: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | |**Note:** double slashes '' | ||
+ | |||
+ | ==== Dependencies with Fieldsets ==== | ||
+ | |||
+ | Sometimes part of a form should only be asked when a certain answer was picked for a previous question. Simple dependencies like that can be created by using Fieldsets. | ||
+ | |||
+ | Consider the following example: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | action | ||
+ | |||
+ | fieldset | ||
+ | textbox | ||
+ | select | ||
+ | |||
+ | fieldset | ||
+ | number | ||
+ | textbox | ||
+ | |||
+ | fieldset | ||
+ | select | ||
+ | number | ||
+ | |||
+ | fieldset | ||
+ | yesno " | ||
+ | |||
+ | fieldset | ||
+ | textbox | ||
+ | number | ||
+ | |||
+ | fieldset | ||
+ | submit " | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | In this example, a user can select to order a car or a blimp. Depending on his choice, the second or third fieldset will be hidden or shown accordingly. The second parameter for the '' | ||
+ | |||
+ | When the user marks the checkbox of the '' | ||
+ | |||
+ | NOTE: | ||
+ | * Apparently dependencies don't work when the choice is provided by " | ||
+ | |||
+ | ===Dependencies with Fieldsets - creating two levels of selects === | ||
+ | How to use dependencies to adapt a select list. Example: | ||
+ | |||
+ | First level " | ||
+ | < | ||
+ | |||
+ | Second level " | ||
+ | < | ||
+ | select " | ||
+ | and | ||
+ | < | ||
+ | select " | ||
+ | |||
+ | To show only the shown value of both select fields " | ||
+ | The chosen one will be filled out and the not chosen one will be replaced by an empty string ("" | ||
+ | |||
+ | ==== Prefilling fields from Links ==== | ||
+ | |||
+ | Sometimes you may want to link to a bureaucracy form and pre-fill one or more fields. This can be easily achieved by adding parameters to your link using '' | ||
+ | |||
+ | Imagining the form given in the previous section is on a page called '' | ||
+ | |||
+ | [[orderform? | ||
+ | |||
+ | ===== Action Modes ===== | ||
+ | |||
+ | Bureaucracy does three things: | ||
+ | |||
+ | - it displays a neat form | ||
+ | - it validates user input | ||
+ | - it sends the user's input to an action mode | ||
+ | |||
+ | The last step is where the data is processed. The action to use is defined in the '' | ||
+ | |||
+ | ==== Mail Mode ==== | ||
+ | |||
+ | This is a simple action. When used default, all user input will be sent by email to the configured email address. See the example above how to use it. You may specify multiple recipient mail addresses separated by commas. | ||
+ | |||
+ | |||
+ | //Example to automate email to an address which the user enters:// | ||
+ | | ||
+ | Fieldset "Some Information" | ||
+ | Textbox " | ||
+ | email Email_Address | ||
+ | |||
+ | |||
+ | Action mail @@email_address@@ | ||
+ | |||
+ | |||
+ | * If you add the field '' | ||
+ | * With the '' | ||
+ | * and by marking field(s) with the option '' | ||
+ | |||
+ | // | ||
+ | action mail @MAIL@ forename@surname.name | ||
+ | usemailtemplate your: | ||
+ | subject "new special subject" | ||
+ | |||
+ | |||
+ | <file - your: | ||
+ | ======Mail template page====== | ||
+ | |||
+ | <code html> | ||
+ | Dear @@Your Name@@, | ||
+ | |||
+ | You are < | ||
+ | |||
+ | We will deliver it fast as possible, see the | ||
+ | <a href=" | ||
+ | |||
+ | Kind regards, | ||
+ | Future Machines company | ||
+ | </ | ||
+ | |||
+ | <code text> | ||
+ | Dear @@Your Name@@, | ||
+ | |||
+ | You are great, you just purchased our @@What do you want@@! | ||
+ | |||
+ | We will deliver it fast as possible, see [1]. | ||
+ | |||
+ | Kind regards, | ||
+ | Future Machines company | ||
+ | |||
+ | [1] http:// | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== Template Mode ==== | ||
+ | |||
+ | This action uses given pages as template, will replace defined placeholders with the user input and create wiki pages. This is a very powerful, but somewhat complex concept. | ||
+ | |||
+ | The action line looks as follows: | ||
+ | |||
+ | action template [template] [destination] [separator] | ||
+ | |||
+ | * '' | ||
+ | * either a single page, | ||
+ | * or a whole namespace (with trailing colon). When a namespace is given, all contained sub namespaces and pages will be copied to the destination and replacement patterns will be applied in all pages. | ||
+ | * when you specify an underscore ('' | ||
+ | * and '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | === Defining the destination(s) === | ||
+ | |||
+ | When using the template mode you need to define where resulting pages should be created. There are multiple ways to do this. | ||
+ | |||
+ | **Method 1** The simplest way is to specify an output namespace and mark up your naming fields using the '' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | action | ||
+ | |||
+ | fieldset " | ||
+ | select | ||
+ | textbox | ||
+ | textarea "Enter a short bio" ! | ||
+ | submit | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | This would create a new page using the continent and name fields. Eg. if I fill in " | ||
+ | |||
+ | **Method 2** Sometimes you want some more control over the resulting pagename(s). This can be achieved by using placeholders in the destination parameter and omitting the '' | ||
+ | |||
+ | Placeholders are the field names surrounded by '' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | action | ||
+ | |||
+ | fieldset " | ||
+ | select | ||
+ | textbox | ||
+ | textarea "Enter a short bio" ! | ||
+ | yesno "Do have publication?" | ||
+ | |||
+ | fieldset "Add your publications" | ||
+ | textarea " | ||
+ | addpage | ||
+ | |||
+ | fieldset " | ||
+ | submit | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The above would create a namespace based on the current year and my name and create a start page within it: '' | ||
+ | |||
+ | |||
+ | **Method 3** When working with [[# | ||
+ | |||
+ | Just put it in the fieldset of question: | ||
+ | |||
+ | addpage additionaltpl somepage | ||
+ | |||
+ | The second fieldset from the example above adds a publication page, via a checkbox. Here the template for additional page is located on absolute path: '' | ||
+ | Only when the '' | ||
+ | |||
+ | === Creating Templates === | ||
+ | |||
+ | The templates need to contain the same fields as your form, and some other placeholders are available too. Some of them can be used as default values for form fields: | ||
+ | |||
+ | ^Placeholder ^ action ^ | ||
+ | | '' | ||
+ | |'' | ||
+ | | '' | ||
+ | |'' | ||
+ | | %Y %F %a %Y-%m-%d %s... etc | [[phpfn> | ||
+ | | < | ||
+ | |''< | ||
+ | | '' | ||
+ | | '' | ||
+ | |'' | ||
+ | |'' | ||
+ | |''< | ||
+ | |''< | ||
+ | |'' | ||
+ | |'' | ||
+ | |||
+ | For the '' | ||
+ | |||
+ | < | ||
+ | ====== @@What' | ||
+ | |||
+ | I'm living in @@What' | ||
+ | |||
+ | @@Enter a short bio|FIXME please fill in your biography@@ | ||
+ | </ | ||
+ | |||
+ | The result then would look somewhat like this with all the user data filled in: | ||
+ | |||
+ | < | ||
+ | ====== Andreas Gohr ====== | ||
+ | |||
+ | I'm living in Europe. I'm a user since 2007-12-23. | ||
+ | |||
+ | It's me :-) | ||
+ | </ | ||
+ | |||
+ | |||
+ | === ACL Checking & runas Option === | ||
+ | |||
+ | By default this plugin will check for [[doku> | ||
+ | |||
+ | However sometimes you may want to give anonymous users a way to create pages in a restricted namespace without giving them any direct access. This is where the '' | ||
+ | |||
+ | Note: the '' | ||
+ | |||
+ | === Accessing user field infos === | ||
+ | |||
+ | When using a '' | ||
+ | |||
+ | * ' | ||
+ | * ' | ||
+ | * ' | ||
+ | * ' | ||
+ | |||
+ | * ' | ||
+ | * ' | ||
+ | * ' | ||
+ | * separator may be omitted then the comma is used as a separator. Eg. @@users.mail@@, | ||
+ | * @@users.grps@@ is not supported | ||
+ | |||
+ | ==== Script Mode ==== | ||
+ | This action gives the data to a PHP script supplied by the administrator. The script then can do whatever it wants with the data. | ||
+ | |||
+ | The script must be placed in '' | ||
+ | |||
+ | That means the class has to have the '' | ||
+ | |||
+ | === Example === | ||
+ | |||
+ | This is a simple script handler that will just print the form's arguments in DokuWiki' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | action script example.php | ||
+ | textbox "Type something" | ||
+ | submit "Write to log" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | <file php conf/ | ||
+ | <?php | ||
+ | use dokuwiki\plugin\bureaucracy\interfaces\bureaucracy_handler_interface; | ||
+ | |||
+ | class helper_plugin_bureaucracy_handler_example implements bureaucracy_handler_interface { | ||
+ | |||
+ | /** | ||
+ | * Log the form fields to DokuWiki' | ||
+ | */ | ||
+ | public function handleData($fields, | ||
+ | { | ||
+ | dbglog($fields, | ||
+ | dbglog($thanks, | ||
+ | |||
+ | return $thanks; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Examples ===== | ||
+ | |||
+ | ==== Checkbox field ==== | ||
+ | |||
+ | Example code for checkbox field: | ||
+ | |||
+ | yesno " | ||
+ | | ||
+ | yesno " | ||
+ | fieldset | ||
+ | textbox | ||
+ | |||
+ | * The checkbox returns the default value '' | ||
+ | * When a fieldset refers to a '' | ||
+ | |||
+ | ==== Number field ==== | ||
+ | |||
+ | number " | ||
+ | number " | ||
+ | number " | ||
+ | hiddenautoinc "Four (notice: conflicts with Two)" | ||
+ | number " | ||
+ | number " | ||
+ | |||
+ | * One Number field accepts only numbers | ||
+ | * Two Number field it remembers the last number and increment it with one, you can change it | ||
+ | * Third Number field accept any number between 3 and 40 | ||
+ | * Fourth Number field is hidden, and increment every time a form is saved. (At the moment this field conflict with an autoincrementing '' | ||
+ | * Fifth Number field returns values which are completed with leading zeros. Input of 23 will be returned as 023. | ||
+ | * Sixth Number is a combination of Two and Fifth | ||
+ | |||
+ | ===== Development ===== | ||
+ | |||
+ | ==== Adding a new field type ==== | ||
+ | |||
+ | To add a new type, you need to implement a [[doku> | ||
+ | |||
+ | If you need more control over adding one or more fields, you can implement an [[doku> | ||
+ | |||
+ | < | ||
+ | $data = array( | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | </ | ||
+ | |||
+ | In your handler you need to check that args[0] is the field type you want to register. If it is, you need to call '' | ||
+ | |||
+ | ==== Adding a new action ==== | ||
+ | |||
+ | To add a new action create a new [[doku> | ||
+ | |||
+ | Theres is also an Event you can hook called '' | ||
+ | |||
+ | FIXME describe passed data in detail. For now check the source. | ||
+ | |||
+ | ==== Influence Template mode ==== | ||
+ | |||
+ | Saving the final page in template mode triggers an event called '' | ||
+ | |||
+ | Passed data: | ||
+ | |||
+ | < | ||
+ | $data = array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ); | ||
+ | </ | ||
+ | |||
+ | ==== Hook into email action ==== | ||
+ | |||
+ | The event '' | ||
+ | |||
+ | This makes it easier to provide custom fields in bureaucracy emails. | ||
+ | |||
+ | The event data includes the form fields info and all the values, so they can be processed by third-party plugins: | ||
+ | |||
+ | < | ||
+ | $evdata = [ | ||
+ | ' | ||
+ | ' | ||
+ | ]; | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Customisations ===== | ||
+ | |||
+ | **Important!** These are //hacks// - there is no guarantee they' | ||
+ | |||
+ | If it breaks you get to keep the pieces. :-) | ||
+ | |||
+ | ==== Customise the Date Format ==== | ||
+ | |||
+ | **NOTE:** The configuration setting for the PHP strftime function in ''/ | ||
+ | |||
+ | To change the default date format from '' | ||
+ | |||
+ | Change the jQuery datepicker format ''/ | ||
+ | <code javascript> | ||
+ | /** | ||
+ | * Init datepicker for all date fields | ||
+ | */ | ||
+ | |||
+ | jQuery(function(){ | ||
+ | jQuery(' | ||
+ | dateFormat: " | ||
+ | changeMonth: | ||
+ | changeYear: true | ||
+ | }); | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | to this:- | ||
+ | <code javascript> | ||
+ | /** | ||
+ | * Init datepicker for all date fields | ||
+ | */ | ||
+ | |||
+ | jQuery(function(){ | ||
+ | jQuery(' | ||
+ | dateFormat: " | ||
+ | changeMonth: | ||
+ | changeYear: true | ||
+ | }); | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | Change the Bureaucracy error message in ''/ | ||
+ | <code php> | ||
+ | $lang[' | ||
+ | </ | ||
+ | |||
+ | to this:- | ||
+ | <code php> | ||
+ | $lang[' | ||
+ | </ | ||
+ | |||
+ | Change the Bureaucracy date validation in ''/ | ||
+ | <code php> | ||
+ | * Validate field input | ||
+ | * | ||
+ | * @throws Exception when empty or wrong date format | ||
+ | */ | ||
+ | protected function _validate() { | ||
+ | parent:: | ||
+ | |||
+ | $value = $this-> | ||
+ | if (!is_null($value) && !preg_match('/ | ||
+ | throw new Exception(sprintf($this-> | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | to this:- | ||
+ | <code php> | ||
+ | * Validate field input | ||
+ | * | ||
+ | * @throws Exception when empty or wrong date format | ||
+ | */ | ||
+ | protected function _validate() { | ||
+ | parent:: | ||
+ | |||
+ | $value = $this-> | ||
+ | if (!is_null($value) && !preg_match('/ | ||
+ | throw new Exception(sprintf($this-> | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | As of release 2016-03-11 it is also necessary to change this:- | ||
+ | <code php|helper.php> | ||
+ | if(preg_match('/ | ||
+ | </ | ||
+ | to this:- | ||
+ | <code php|helper.php> | ||
+ | if(preg_match('/ | ||
+ | </ | ||
+ | |||
+ | **Now packaged as a plugin** - [[doku> | ||
+ | ====Customise the Thankyou message===== | ||
+ | |||
+ | To allow inserting DokuWiki code into the Thankyou field. | ||
+ | |||
+ | Change the syntax in '' | ||
+ | <code php> | ||
+ | $thanks .= '< | ||
+ | </ | ||
+ | |||
+ | to this:- | ||
+ | <code php> | ||
+ | $thanks .= p_render(' | ||
+ | </ | ||
+ | |||
+ | |||
+ | Which then allows the use of a link back to the same page when processing a Bureaucracy form:- | ||
+ | <code dokuwiki> | ||
+ | Thanks [[$examplepage|Continue]] | ||
+ | </ | ||
+ | |||
+ | **NOTE:** If form creates a data plugin edit table the wiki code needs to be quoted (surrounded by //" "// quotes as in the example below) <code dokuwiki> | ||
+ | Thanks " | ||
+ | </ | ||
+ | |||
+ | ===== CSS Formatting ===== | ||
+ | |||
+ | * [[doku> | ||
+ | * User-Forum: [[https:// | ||
+ | |||
+ | ===== Issues ===== | ||
+ | |||
+ | Please report bug or feature request on the [[https:// |