Plugin Tracker
This is a Wiki Plugin for the tracker feature that allows you to display in a wiki page a tracker creation form. You can specify what fields will be included in the form.In Tiki6, this plugin can also be used as a simple way to create custom forms which output the result as preformatted wiki pages instead of tracker items.
PluginTrackerlist - which displays a given tracker items.
Table of contents
Use
{TRACKER(trackerId, fields, action, showtitle, showdesc, showmandatory, embedded, email, view, url)}user-defined text{TRACKER}Parameters
| Parameters | Accepted Values | Effect | Version |
|---|---|---|---|
| trackerId | numeric | is the numeric ID of the tracker to be used | |
| fields | numerics separated by : | is the list of the numeric field IDs separated by :. If fields param is omitted, all the possible fields are added. The fields param can be empty to allow the plugin to work only on status for instance | |
| sort | y or n | Displays the fields in the order of the fields param and not the order of tracker (default n) | 2.0 |
| action | string | is a user-defined name of the button to validate the form (default: Save) | |
| showtitle | y or n | shows the tracker title at the top of the form | |
| showdesc | y or n | shows the tracker description | |
| showmandatory | y or n | shows the mandatory fields with a * | |
| showstatus | y or n | show the input status select (default: n) | 5.0 |
| embedded | y or n | page????? | |
| from¦to¦template | to send an email when the tracker item is created. The fields are separated with a bar where this example uses ¦ (pipe char). *from is an email or the fieldId containing the email, to is an email or a list of emails separated with commas or the fieldId containing the email, template is a list of commas separated templates. Each template will contain the message body. The first template will be used for the first to, the second template if exists will be used for the second from (otherwise the last given template will be used. The subject will be the template_subject.tpl. Both templates must be in the templates/mail directory. Example: "webmaster@my.com¦a@my.com,b@my.com¦ta.tpl,tb.tpl" (templates/mail/tracker_changed_notification.tpl is the default from which you can get inspiration) | ||
| url | ur<x>l | url the user will be sent after the item creation. Notice that if you have problem with the parse, you can put double quotes around the url (ex: ur<x>l="http:/tiki.org"). In tw>=4, if the url contains the string itemId, the string itemId will be replaced with itemId=xx where xx is the new (or current) itemId | 1.9.8 |
| If the url comtains itemId, the link will be completed with the value of the itemId(ex: ur<x>l="mypage&itemId") | 4.0 | ||
| values | value separated by : | the list of default values for the fields. The first value corresponds to the first fielId, the second to the second fieldId. Default values can be set from the URL see below. | 2.0 |
| overwrite | y or n | values overwrite the current value of the item | 6.0 |
| Each value can be delimited with double quotes to allow them to contain : and the values is only assigned to new items, | 3.0 | ||
| preview | text | will add a button with the label = the value of preview (or Preview by default). This is useful to see the computed fields of an item | 2.0 |
| user-defined text | text | the user-defined text will be displayed when the tracker item will be recorded ( For example, it can be "Thank you") | |
| view | user(the string user) or page(the string page | if =user: will modify the item associated to the user. If trackerId is specified it will be the item of this tracker associated to the current user (2.0). If no trackerId is specify, it will be the user tracker (the tracker associated with the default group)(tw>=1.9.7 | 1.9.7 |
| if =page: will modify the item associated to the page, trackerId must be specify | 3.0 | ||
| tpl | file.tpl | the name of the templates to display the form with this template. In the template, the smarty variable {$f_id} will be replaced with the appropriate < input> tag. The < form> tag and the submit button are generated by Tiki outside the template | 2.0 |
| wiki | pageName | the name of a wiki page that will be the template (like .tpl). This page must have the permission tiki_p_use_as_template assigned to the Anonymous group to be used as a template | 2.0 |
| newstatus | c or p or o | will change the status of the item to this value (c for close, p for pending and o for open when the item is saved | 2.0 |
| colwidth | numeric | Specify the width (or percentage) of the first column, the label, in the form | 3.x |
| target | _blank_, _self_... | targets the window for the resulting address | 2.0 |
| itemId | ID | to edit an item | |
| ignoreRequestItemId | y or n | to ignore the itemId of the URL (default n) | 6.0 |
| autosavefields | numerics separated by : | fields that will be automatically filled with a value at save time | 5.0 |
| autosavevalues | values separated with : | values associated to autosavefields | 5.0 |
| Note that categories(x) is a special syntax to select the first child category under category x for a category field, in the original use-case the admin would periodically create/move a new category as a subcategory of category x and while that was the case new items would be created with that category | 5.0 | ||
| There is also a special syntax preference(x) for the value of preference x | 8.0 | ||
| levelupfields | Values separated with : | Used with autosavefields. Specifies fields where the value can only go up, not down, in other words the specified autosavevalue will not take effect if it is lesser or equal to the current value of the field. Useful for Plugin Tracker Advanced | 8.0 |
| outputtowiki | numerics | Specifies a fieldId. If specified, result of the form will be posted to a new wiki page with the name of this new page taken from the input for this specified fieldId. | 6.0 |
| outputwiki | valid pagename | For outputtowiki to work, this must be set to the name of a wiki page that is the template for new pages being created. The template can contain {$f_6} for example as placeholders for the inputted value for field 6 | 6.0 |
| discarditem | y or n | This is used in conjunction with outputtowiki. The default is n. If set to y, the tracker item that is created is discarded once the wiki page is created. In effect, the tracker is just a vehicle to create form fields to facilitate creating wiki pages. | 6.0 |
| registration | y or n | Registration tracker, special capabilities for use in register - this is used in tiki-register.php in tiki 6 | 6.0 |
overwrite param is only to overwrite tracker items (not wiki pages) - not useful when discarditem="y"
When using outputwiki as template you cannot use Smarty syntax programatically because the resulting output is static wiki page (not computed against an existing Tracker Item like with Pretty Trackers and TrackerLists) - you can use only {$f_XX} to indicate the fields values or Argument variables.
Administration
- You can limit the tracker fields that can be used in this plugin in the field admin panel of the tracker:
"Field is public? for use with trackerlist plugin option
For Tiki 9.x, the User Selector field (the "userId" field in your tracker, perhaps), edit the field, Permissions, Visibility, Visible by All (even though that's counter-intuitive (you want those items private to that use). - If you have a tracker that has only one item per user/IP or if you use the plugin with the param view=user, the plugin will automatically the item if already exists.
This plugin can not be used on a cached wiki page.
Example
{TRACKER(trackerId=1, fields=1:3:4, action=>Send)} Thank for your contribution! {TRACKER}How to prefill some fields
In some situation you want to go in a TRACKER page (for our example named SubmitOrder ) where fields are automatically prefills. In this case you can use an URL like thistiki-index.php?page=SubmitOrder&autosavefields=1&autosavevalues=tikiwiki
When in the page SubmitOrder, you click on save the field 1 will be filled with the value tikiwiki. If the field 1 is multivaluated field(ex: category), the value will be added to the potentially additional value the user has selected whatever the user do.
Tip:
The construction of such url can use the feature 'Wiki argument variables'
(see Advanced Wiki Syntax usage examples)
tiki-index.php?page=SubmitOrder&autosavefields=2:3&autosavevalues=:PluginTracker
See also PluginTrackerList to see how to use the parameter url to transfer an itemId to an URL or PluginJQ if you want to use JQUERY
How to fill an item in more than one step
If you want to fill some fields of an item in a page and to fill some other ones in another page, you need to use the param url with the itemId option.Example (uses SEFUrl enabled links):
Page1
{TRACKER(trackerId=1, fields=1:2:3, url="Page2&itemId") /}Page2
{TRACKER(trackerId=1, fields=4:5:6, url="Page3&itemId") /}Page3 - the final one that will display the currently submitted itemId:
{TRACKERLIST(trackerId=1, fields=1:2:3:4:5:6) /}How to write a template
As mentioned, in a template, use the{$f_id} syntax to insert the value of fieldId=id.It is also possible to insert the ItemId itself, which is usefull to create new wiki pages with tracker plugins inside. To do this you'll have to add an Auto-Increment Field to your tracker, with the appropriate options to auto-fill it with the itemId. This new field content (itemId value) can then be inserted in the template with the syntax seen above.
How to go from TRACKELIST to TRACKER on this item
{TRACKERLIST(trackerId=1, fields=1:2:3:4:5:6, url="Page1&itemId", show