Loading...
 
Skip to main content

History: PluginTrackerItemField

Preview of version: 35

Plugin TrackerItemField

This Wiki Plugin is one of several that works with the trackers feature (since version 2.0).

See also PluginTrackerIf and PluginTrackerToggle

This plugin allows you to display or to test the value of a field of a tracker item.
Limitation: the field must be a simple value (not computed, not item list).
The tracker item can be specified by its ID with the itemId plugin param. If it is not specified, if the url has a param itemId, the value of itemId will be used. If after this test is not set and if the User Tracker feature is set on, the user item of the user will be selected.

For example, you have a user tracker with a field containing the phone number of the user, you can use this plugin with the fieldId=>phone_field_id to display in the page the phone number of the user looking at the page

Copy to clipboard
{TRACKERITEMFIELD(fieldId=1) /}


Another example, you want to add a link in a page to a page where a user can fill his user tracker only if the user has no user tracker. You can use this plugin with the fieldId that is the user selector field.

Copy to clipboard
{TRACKERITEMFIELD(fieldId=1, test=1)}Welcome new member, please visit ((this_page)) to fill up your information{TRACKERITEMFIELD}

A field can be tested against a value

Copy to clipboard
{TRACKERITEMFIELD(fieldId=1, test=1, value=toto)}Yes your name is toto{TRACKERITEMFIELD}

See Tracker Field Type for values to match for special fields such as checkboxes.

If you want to do the same thing with a tracker that is not the user tracker but has only one item per user and has a field user selector/1, you can specify the tracker ID like this

Copy to clipboard
{TRACKERITEMFIELD(trackerId=1, fieldId=1) /} {TRACKERITEMFIELD(trackerId=1, fieldId=1, test=1)}Please fill out your review{TRACKERITEMFIELD}


It is also possible to test the status of the user item. For instance if you want to display something only if the item is pending or closed

Copy to clipboard
{TRACKERITEMFIELD(status=pc)}Sorry, your survey is been processed{TRACKERITEMFIELD}


It is also possible to test if all the fields of as item are not empty

Copy to clipboard
{TRACKERITEMFIELD(trackerId=1, fields=)}Thank you your form is filled up{TRACKERITEMFIELD}


It is also possible to test an alternative

Copy to clipboard
{TRACKERITEMFIELD(fieldId=1, test=1)}OK{ELSE}NOT OK{TRACKERITEMFIELD}


It is possible to have multi-lever of ELSE

Copy to clipboard
{TRACKERITEMFIELD(fieldId=1, test=1)}OK{ELSE}{TRACKERITEMFIELD(fieldId=2, test=2)}super ok{ELSE}NOT OK{TRACKERITEMFIELD}{TRACKERITEMFIELD}

Note the order the other test with always be in the ELSE part

Syntax

Example:

Copy to clipboard
{TRACKERITEMFIELD(trackerId=1,itemId=1,fieldId=1, test=1,fields=1:2,value=1)}Text{ELSE}Text{TRACKERITEMFIELD}

Options

Name Type Meaning Optional or mandatory Version
itemId Numeric The id of the item that is used. If the param is not specified, the user tracker item for the current user will be selected optional
trackerId Numeric the Id of the tracker. the item that will be used will be the user item(the tracker must have a user selector with a param 1, and the tracker must have only one item per user) optional
fieldId Numeric The id of the field displayed or tested. The perms are checked according the item status optional
value text value of the field optional
test 1 or 0 If 1, the value field must not be empty if the value parameter is empty or the value must be the same, otherwise the Text is displayed optional
status o or p or c or op or oc or pc or opc test the status of the item (the test is done even if the user has no view perm) optional
fields fieldId separated with : or empty test if a list of fields or all the fields are empty optional

Security

  • The field must not be hidden
  • To test or display a field, you must have the tiki_p_view_trackers (or tiki_p_view_trackers_pending or tiki_p_view_trackers_closed depending on the status of your item
  • the status can be test without permission

Optimisation

If this plugin is called many times on the same page with the same itemId, some sqls queries will be remembered between each call

alias

History

Information Version
Marc Laporte 42
Aris Bernotas 41
Aris Bernotas 40
Aris Bernotas added info how to assign itemId value from object_id 39
Yves Kipondo 38
lindon 37
lindon 36
Marc Laporte 35
Marc Laporte 34
pianoliv +link to ((Tracker Field Type)) 33
lindon 31
lindon 30
Marc Laporte 29
Marc Laporte 28
Marc Laporte 27
Marc Laporte 26
Marc Laporte 25
Scot Wilcoxon description 24
lindon 23
Marc Laporte 22
Marc Laporte 21
gcosilveira 20
sylvie 19
sylvie 18
sylvie 17
sylvie 16
sylvie 15
sylvie 14
sylvie 13
sylvie 12
sylvie 11
sylvie 10
sylvie 9
sylvie 8
sylvie 7
sylvie 6
Jürgen Heckes 5
mlpvolt 4
mlpvolt 3
Jürgen Heckes 2
sylvie 1