History: PluginTracker Advanced
Source of version: 21 (current)
Copy to clipboard
{syntax type="markdown" editor="wysiwyg"} # PluginTracker Advanced On this page we describe some special uses of the very talented ((PluginTracker)) and how it integrates with the wiki, for example how ((pretty tracker)) is created. ## Setting default values for the tracker (form) **set some default values in the tracker from the plugin**: For each field, you have to specify a value. If you do not want a default value set nothing {CODE(colors="tiki")} {TRACKER(trackerId="1" fields="1:2:3" values="first::second")}Thank for your contribution!{TRACKER} {CODE} Will default fieldId 1 to first, and fieldId3 to second Note: For JS Calendar fields, enter the date and time using a Unix-style timestamp ## Having different defaults by linking to different pages **set some default values in the tracker from the url**: Example: I have a trackerplugin in a page A with fields=1:2:3 If I call the page with `tiki-index.php?page=A&values[]=first&values[]=&values[]=second` , I will have at the first access of the page, the field 1 prefilled with first and the field 3 prefilled with second. If I want only some fields to be default I need to use `prefills` . Example: `tiki-index.php?page=A&prefills=1:3&values[]=first&values[]=second` This kind of url can be built with the tracker ((PluginTrackerPrefill)) ## Multi-page tracker forms **fill up a tracker item on different pages** The tracker must have a field 'user selector' with option 1. On one page you can use {CODE(colors="tiki")}{tracker trackerId="1" view="user" fields="1:2" action="Save and Next" url="tiki-index.php?page=next"} {CODE} in the first page and in the page Next {CODE(colors="tiki")}{TRACKER(trackerId="1" view="user" fields="3:4" action="Save")}Thank you{TRACKER}{CODE} In TIki 8, there is also a way to use `autosavefields` and `levelupfields` to store a value in the field that keeps track of at what stage the user has completed the multi-page form. ## Conditional display of input fields - ((PluginTrackerToggle)) - ((PluginJq|#Conditional_display_of_fields)) ## Custom designed (using wiki, css or html layout) forms **To use TRACKER plugin to place data-entry fields anywhere you want on a page** - First, create a wiki page that will be used as a template file, call it something like TrackerWikiTpl. Somewhere in it, put your field placeholders. {CODE(colors="tiki")}||{$f_2085}|{$f_1019} {$f_1020}| {$f_1021}||{CODE} **Note:** replace the numbers above with your actual fieldIds - check "edit fields" in the tracker list. - Change the perms on the template as described in the big table above. (Note: seems to work without that permission set, but don't be fooled--set `tiki_p_use_as_template` on your templates.) - Do NOT have `tiki_p_admin_trackers` as special perm on the user tracker (tiki-objectpermissions.php). - If you want the user tracker data private only to each user, set `tiki_p_create_tracker_items` and `tiki_p_modify_tracker_items` permissions for the user group on the user tracker (there may be a bug here...) (tiki-objectpermissions.php). - Set "Item creator can modify his items" to yes (checked) on the user tracker (tiki-admin_trackers.php). - Set "Only one item per user or IP" to yes (checked) on the user tracker (tiki-admin_trackers.php). - Create another wiki page, call it something like DataEntry. In it, place code such as this: {CODE(colors="tiki")}{tracker trackerId="4" wiki="TrackerWikiTpl" view="user"}{CODE} (trackerId seems to be required at the moment). - Request the DataEntry page in your browser: `http://yoursite.com/tiki-index.php?page=DataEntry` - Tiki will replace your TRACKER tag in DataEntry with the contents of the TrackerWikiTpl with the editable fields arranged as you wished. - Here is a simple example of the kinds of complex data-entry tables you can create: {img src="img/wiki_up/20080613_ScreenshotTrackerPluginTableTrimmed.png" width="50%"} See also [http://doc.tiki.org/PluginTrackerlist] the section pretty tracker