TrackerList (트래커 목록) 플러그인
트래커 를 위한 이 플러그인은 트래커의 나열된 항목의 리포트를 표시하도록 합니다. 표시를 원하는 항목을 선택할 수 잇으며, 항목의 상태를 표시할 수도 있으며, 항목을 필터링할 수도 있습니다. 공용으로 설정된 필드들만 플러그인을 통하여 제공됩니다.
{TRACKERLIST(trackerId=>1, fields=>2:4:5, showtitle=>y|n, showlinks=>y|n, showdesc=>y|n, showinitials=>y|n, showstatus=>y|n, status=>o|p|c|op|oc|pc|opc, sort_mode=> , max=> , filterfield=>,filtervalue=> , exactvalue=> , checkbox=>fieldId/name/title/submit/action/tpl)}Notice {TRACKERLIST}
매개변수
-
매개변수 | 선택사항/문법 | 기본값 | 설명 | 버전 | |
---|---|---|---|---|---|
trackerId | (numeric) | 필수 | 해당 트래커의 ID 번호를 입력해야만 합니다 | ||
fields | (숫자, 콜론으로 구분됨) | 지정된 트래커 필드의 선택을 허용. 2.0 부터는 필드ID들의 순서가 sort 매개변수가 'y' 인 경우 필드ID 들의 순서가 보존됨, 1.9, 에서 순서는 트래커에 정의된 순서 | |||
showdelete | y/n | n | Display the delete icon for each item | ||
sort | y/n | n | Displays the fields in the order of the fields param and not the order of trackerlist | 2.0 | |
popup | (numeric, colon separated) | When passing the mouse on a field with a link to the item in the list, a popup with the values of these field will be displayed | 2.0 | ||
stickypopup | y/n | n | The popup will be sticky = displayed until another popup is displayed(useful when link inside the popup) | 2.0 | |
showtitle | y/n | n | Displays the title of the tracker | ||
showlinks | y/n | n | Hyperlinks to the tracker item view for each item. There should be at least one field marked as browsable for this to work. This does not affect other links like page selector links. | ||
shownbitems | y/n | n | Displays the number of items found | 2.0 | |
showinitials | y/n | n | Displays an alphabetical index by first letter (A,B,C,...) above the list to assist navigation. All the items that have a field value beginning with this letter will be filtered. | ||
showdesc | y/n | n | Displays the Tracker's description | ||
showfieldname | y/n | y | Displays the Tracker field names as heading of the table | 1.9.8 | |
showcreated | y/n | Tracker config | Displays the creation date | 2.0 | |
showlastmodif | y/n | Tracker config | Displays the last modification date | 2.0 | |
status | o/p/c/op/pc/oc/opc | o | Filters by status (open,pending,closed) - e.g. "op" displays only the open and pending items. | ||
sort_mode | f_fieldId_asc or f_fieldId_desc or created_asc or created_desc or lastModif_asc or lastModif_desc | default (numerical) order | Orders the columns of the tracker ascending (_asc) or descending (_desc). Replace fieldId with the desired ID Number of the field. Example: sort_mode=>f_2_asc. | ||
max | (numeric)=> or -1 for all values | Default is the list number set in admin->general | The maximum number of items to list. Note: max=-1 also removes pagination from the plugin. |
||
filterfield | tw<2.0 numeric, tw>=2.0 list of numerics separated with : | The field Id or the list of fieldIds used for filtering | |||
filtervalue | tw<2.0 text, tw>=2.0 list of texts separated with : | Filter value of the filterfield. (ex: *value will display items where the filtered field value ends with "value" string, value* will display anything where it begins with, value will display matches containing the string) If you use the special param value #user, the value will be automatically replaced with the user name (be careful because it will look for all the user name matches that has part of their name containing the current user's login name) See extra notes at the bottom of this page regarding filtering on item list fields | |||
filterfield value | #user | is replaced with the current user's login name. | 3.0 | ||
filterfield value | #group_default | is replaced with the current user's default group. | 8.0 | ||
exactvalue | tw<2.0 text, tw>= 2.0 list of texts separated with ¦ (pipe, vertical bar) | Exact value of the filter (if filterfield is an array, exact value must be an array). | |||
categories(x) | where x is a categoryId: it will filter all the items having this category or any descendant categories of this category. You can also use notcategories(x). | 5.0 | |||
preference(name) and notpreference(name) | that will filter against a value of a Tiki preference. | 5.0 | |||
not(value) | where value is the value you do not want the field to be equal to | 6.0 | |||
field(x, id) and notfield(x, id) | where x is a fieldId to filter against the value of the field x of the item id. If id is not specified , field(x) when the URL param itemId is used. | 5.0 | |||
To filter on a field value of a user trackeruse field(x, user, y) where x is the field from the user tracker, user is the string user, y is the trackerId. | |||||
less(val), greater(val), lessequal(val), greaterequal(val) | also also the filter against a less or greater value val. If the field is a date field, a value equals to now will filter on the current date or a value formatted as date format (http://us.php.net/manual/en/function.strtotime.php) will filter on this date | 6.0 | |||
checkbox | see below | Adds a checkbox on each line to be able to do an action. The parameters of this parameter are separated with "/" | |||
goIfOne | y or n | n | Go directly to tiki-view_tracker_item.php if only one item is found | 1.9.8 | |
more | y or n | n | A more button that links to tiki-view_tracker.php | ||
moreurl | url | ||||
tpl | file.tpl | A smarty template that allows to display each item with this template: {$f_fieldId} is the parsed value of the field for this item. |
2.0 | ||
wiki | pagename | The same function as tpl but using a wiki page content as a template. The page should have the permission tiki_p_use_as_template set, and that page should be only open for edition to fully trusted users such as other site admins. | 2.0 | ||
tplwiki | pagename | The same function as wiki (using a wiki page content as a template) but with as little parsing as when using tpl files on disk. This is useful to allow editing collaboratively scripts in other languages (like R through PluginR) by means of wiki pages with version history, etc. The page should have the permission tiki_p_use_as_template set, and that page should be only open for edition to fully trusted users such as other site admins. | 6.5 & 7.1 | ||
view | user or page | view=user will display only the items of the current user for the trackerId In Tiki v.9.x, view=user will limit the output list to one single item; omit it from the TRACKERLIST plugin if you want a longer list of items |
2.0 | ||
view=page will display the item of the page (the tracker must have a page selector field with the automatic feeding set to "1") | 3.0 | ||||
view_user | string | Will display the items of the specified user | 2.0 | ||
url | url | The link that will be on each main field (showlinks must be 'y'). If the URL contains itemId, the link will be completed with the value of the itemId (ex: url="mypage&itemId") | 2.0 (3.0 for itemId) | ||
ldelim | string | { | Smarty left delimiter (for latex generation you can use @{ for instance|2.0 rdelim|string|} | Smarty right delimiter (for latex generation you can use }@ for instance | 2.0 |
list_mode | y or n or csv | y | if csv, the value will be output without any html formatting (useful for e.g. image type field customization in pretty tracker), if n the value will be output as in tacker item view, if y the value will be listed as in tracker list view (e.g. image thumbnail, strings truncated to 255 characters, etc.) | 3.0 | |
itemId | ID | the itemId if list only this item (tw >=4, if itemId is defined in the url, the value will be used | 2.0 | ||
ID:ID:ID | a list of itemIds separated by : | 3.0 | |||
export | y or n | n | will add a button that links to the tracker export page with the fields and eventual filters from TRACKERFILTER preset | 3.0 | |
compute | fieldId/operator :fieldId/operator | a list of fieldId/type_operation separated by : . Decimals in values are indicated with the dot (".") and not with the comma (","). | 3.0 | ||
showitemrank | y or n | n | will show a column rank with the rank of the item | 4.0 | |
silent | y or n | n | will show nothing at all if no items | 4.0 | |
showpagination | y or n | y | will show pagination links id needed (when max is not -1 and if there is more than one page) | 4.0 | |
sortchoice | sorts separated by ¦ (pipe, vertical bar) | ex: sortchoice='created_desc¦Newest first:f_5_desc¦High rank first' will display a select box with sort option. Each option is composed of a value and a label. The value is some like the sort_mode parameter. This is convenient for pretty tracker where you do not have the table header. | 5.0 | ||
showwatch | y or n | n | will show the watch icon (feature and perm must be correctly set | 5 | |
ignoreRequestItemId | y or n | n | if the url param contains itemId, trackerlist is automatically filtered on this itemId. You can disable this feature by using this parameter | 5 | |
calendarfielddate | fiedIf or filedId:fieldId | One or 2 date fieldIds (see below more description) | 6.0 | ||
calendarviewmode | month or bimester or trimester or quarter or semester or year | month | period of the view | 6.0 | |
calendarstickypopup | y or n | n | The popup listing the event can be sticky or not. | 6.0 | |
calendarbeginmonth | y or n | y | Begins the display at the beginning of the month not a the week | 6.0 | |
displaysheet | y or N | n | Displays the list of items as a spreadsheet, the columns are the fields and the line are the items | 6.0 | |
periodQuantity | numeric | n | Numeric value to display only last tracker items created within a user defined time-frame. Used in conjunction with the next parameter "Period unit", this parameter indicates how many of those units are to be considered to define the time frame. Use in conjunction with "max=-1" to list all items (by default "max" is set to 10). | 6.5, |
|
periodUnit | hour/day/week/month | n | Time unit used with "Period quantity" | 6.5, |
|
periodType | c/m | c | Period type to be considered: time since creation of items ("c"), or since last modification ("m") | 6.7, |
|
editable | fields | (numeric,colon separated) | List of fields for which inline editing will be enabled. | 11.0 | |
editableall | y or N | n | If enabled, all displayed fields (as indicated in the fields param will be used as the list of editable fields. | 11.0 |
filterfield
- when filterfield is a dropdown box, exactvalue must be the text of the item in the drop down list without quotation marks
- when filterfield is a category, exactvalue must be the numeric id (without quotation marks) of the category item to filter the list
- when filterfield is a checkbox, exactvalue is y or n
Please note that there might be a bug in Tiki 9.x and later versions, which causes filterfield work when fields param is missing only for Admin users. To make it work for other Groups, you need to set fields param and explicitly name all fields you want to display. For example:
{trackerlist trackerId="2" list_mode="csv" fields="17:42:43:44:47" filterfield="44" exactvalue="y" tplwiki="Template page for a Slide"}
After tw>=2.0 filterField can specify a list of fieldIds. In this case filtervalue and exactvalue must be synchronised to filter the value of each field
- Example: filterfield=1:2, filtervalue=this:that
will filter the items with the field 1 'like' this and field 2 like 'that'
- Example: filterfield=1:2, exactvalue=this:that
will filter items with the field 1 equals to 'this' and field 2 equals to 'that'
- Example: filterfield=1:2, filtervalue=:this, exactvalue=that
will filter items with field 1 equals to 'that' and field 2 likes 'this'
- Example: FieldId 1 is the itemId fields (auto-increment itemId) filterfield=1, notfield(1) and with an url containing itemId will give all the items except the onde defined in the url
Filtering on item list fields
Note that for filtering on item list fields through filterfield, it is important to ensure that fields contain the filterfield id as well. This is because of the special way item list fields are filtered due to its special nature.
Also, if there are multiple items in the value of filterfield, the value you should attempt to match against is item1,item2,item3 if using exactvalue. If you are using filtervalue which does partial matching, from Tiki 6.2, you can match against ",item1,item2,item3,". This is to avoid ambiguity in certain cases. For example, if you are trying to match for a number like "32" in a sequence of numbers like "132,32,321" it can be ambiguous since you might accidently get those that match "21,132". To solve this, from Tiki 6.2, you can set the filtervalue to ",32," to make sure you match only those sequences that include 32 and not things like 132.
checkbox params (or how to send a message to multiple users shown through plugintrackerlist)
Its params are: fieldId/postName/Title/Submit/ActionUrl/tpl/(empty)|radio|dropdown
- fieldId is the field Id whose value will be posted to the action
- postName is the name of the post
- Title is the title of the button
- Submit is the name of the submit button
- ActionUrl is the script that will be called on the submit
- tpl is an optional template that be inserted before the submit button that will also be returned
- radio or dropdown. If this param is left blank/empty, multiple checkbox will be used instead.
Example:
checkbox="6/to/Email to the checked/submit/messu-compose.php//"
in this example the fieldId 6 is the user name as messu-compose.php accepts to as param, and multiple checkboxes will be shown on the left to select one or more user to send a message to.
How to go from a TRACKERLIST page to a page with a TRACKER for a specific item
You want to be able from a TRACKERLIST page to select an item and to go on another page where you can modify your item. We will call this page UpdateItem. We will suppose that the field 1 is a main field (it display a link to the item.
To do so use the parameter url in TRACKERLIST
{TRACKERLIST(....fields=1, showlinks=y, url="tiki-index.php?page=UpdateItem&itemId=") /}
The page UpdateItem needs just to use a regular TRACKER plugin. If itemId is present in the URL, it will be automatically prefilled with the value of the item.
'pretty trackers' (param tpl or wiki)
tw>= 2.0
It is possible to control how an item is displayed in a page by using a smarty template or a wiki page containing smarty code. In the case of a wiki page containing smarty code, keep in mind that this page should be kept editable only by trusted users, such as other site admins.
For instance in a page (named 'list of items in tracker 5') for example, you have
{TRACKERLIST(trackerId=5, fields=30:31, showcreated=y, wiki=tpl for each item in tracker 5) /}
where fieldId=30 and fieldId=31 are 2 fields of the trackerId 5
In the page named 'tpl for each item in tracker 5', you will have
http://doc.tiki.org/tiki-editpage.php?page=PluginTrackerList&hdr=5 {$f_30} : {$f_31}{tr} was created in {/tr}__{$f_created|tiki_short_date}__
PS: the wiki page 'tpl for each item in tracker 5' needs the perm tiki_p_use_as_template for anonymous (or registered, depending on your case) to be displayed, and tiki_p_edit for admins, in order to prevent any users to add any smarty code in it, which might be unsafe.
When displayed, the page 'list of items in tracker 5' will look like this
324: foobar was created on __Thu 23/10/08__ 311: toto was created in __Wed 23/10/07__
There is no more table (if you did not recreate them in 'tpl for each item in tracker 5' for course). Of course the name of the 'template' page is whatever you want - you need only to give the good reference in the param 'wiki'
PS: $f_created and $f_lastmodif have been introduced in tw>= 3.0. They display the integer value of the associated date. $f_status and $f_status_input in tw>=5.0. $f_status will output o or p or c. $f_status_input will output the status select box.
Tip: you can use {$f_created|date_format:"%I:%M %p"} or {$f_created|tiki_short_date}
You can use also a template file in the file system
{TRACKERLIST(trackerId=5, fields=30:31, showcreated=y, tpl=B) /}
and create a templates/B.tpl. In this case no permissions are required.
How to have a pagination between the items accessed by TRACKERLIST (tiki>=6)
No Pretty Tracker
- If you do not use pretty tracker for instance a TRACKERLIST with no url param and a param showlinks=y, each time you click on an item link you will go to tiki-view_traker_item.php and you will see pagiantion between item.
- If you are using TRACKERLIST with the url param equals to "page&itemId" for instance and if you want that each item displays a pagination to the next/previous item you need to have showpagination=y in the TRACKERLIST params
- THis pagination is very convenient when you are using TRACKERFILTER or use some specific filtering of TRACKERLIST as only the filtered items are in the pagination
With Pretty Tracker (starting with Tiki11)
- If using custom templates for display (pretty trackers), use tr_offset instead of itemId. Here's an example of how this can be used:
- Use PluginTrackerList to list items from a tracker.
- Set the url parameter to url="ItemPageName&tr_offset". This will cause title fields in the list to be links to this page
- ItemPageName will consist of another instance of PluginTrackerList.
- This time the fields parameter should include the field IDs that should appear on the individual item page.
- showpagination should be set to y so that pagination with be shown
- The wiki or tpl parameter will be set to the custom template page that has been created to display single tacker items from this tracker. Since the tr_offset parameter was set when calling this page, only one item will be shown.
URL Params
- tr_user: if &tr_user=username is set in the URL request, the plugin loads the specified user item(s) (trackerId must be specified)
Nested plugins in 'pretty' templates
Since Tiki6.0, it is possible to 'nest' plugins - meaning another plugin can be invoked in the template file where smarty code is used to assign parameters which are defined by the first trackerlist.
- WARNING: will only work if the first (or any level except the last) trackerlist delivers one item
For example:
If a 'first level' plugin such as:
{trackerlist trackerId="2" view="page" max="1" fields="43:50" filterfield="43" exactvalue="Test Reference" wiki="insert_location tpl" status="opc" ignoreRequestItemId="y"}
is used in a wiki page, and the wiki template "insert_location tpl" has within it a second level plugin such as:
{trackerlist trackerId="30" fields="75:907" list_mode="n" filterfield="75" exactvalue="{$f_50}" wiki="stdlocmap tpl"}
where the wiki template "stdlocmap tpl" is as follows:
{$f_75}
{$f_907}
Then the result is that the original page will display the field values f_75 and f_907 from the second tracker (id# 30) where the item is defined by a match between a designated value in the tracker and the same value in the second tracker.
Parameter compute
This allows you to display global information about a numeric field like the sum of all the values or the average.
Tiki6: The items shown by the tracker list (e.g., filtered with the parameters "filtervalue" or "exactvalue") are the only ones used for the computation (average or sum), and not all the items in the same tracker.
{TRACKERLIST(trackerId=5, fields=12:15:142:466, compute=142:466/avg) /}
will give something like
If you want to use sum and average on the same field use compute=146/sum:146/avg
Decimals in values are indicated with the dot (".") and not with the comma (",").
page field
If your tracker has a field named 'page' and if the url contains the param 'page', TRACKERLIST will automatically filter the items that have the value of the page url param equal to the page item filed value.
How to filter a tracker function of a field in a user tracker.
For instance, you have a user tracker with a field Town, you have another tracker listing all the bakeries. This tracker has also a field Town. You want to display all the bakeries in the town of your user. For this you can use
{trackerlist trackerId="5" fields="21:23:24" filterfield="20" exactvalue="field(38,user,7)"}
where 5 is the trackerId of the bakery, 20 is the fieldId of Town in the tracker bakery, 38 is the fieldId of the Town in the user tracker 7.
You can use as many filters you want. For instance, you can filter on the Town and the nationality with the type of bakery...
With the same principle, you can display all the items of the user tracker that have the same Town than the user. or the same Town and same age that the user.
Tracker as calendar
With the parameter calendarfielddate, you can display the list of the items in a calendar view. See Module calendar_new. The plugin collects all the items of the period and displays in a popup the items. The display is either the pretty tracker template specified by the param wiki or the value of main field.The calendarfieldate can contain either a single date field or 2 date fields.
Example:
Has been produced by a user module containing the code:
!!!Formations à venir {TRACKERLIST(trackerId=11, ignoreRequestItemId=y, fields=56:58, url="formation&itemId", showlinks=y, filterfield=56, exactvalue="greaterequal(now)", calendarfielddate=56, calendarviewmode=month, calendarstickypopup=y, wiki=trackerCalendrierFormation, calendarviewnavbar=n, wiki=trackerFormationCalendrier, calendarviewnavbar=partial) /} {TRACKERLIST(trackerId=11, ignoreRequestItemId=y, fields=56:58, url="formation&itemId", showlinks=y, filterfield=56, exactvalue="greaterequal(now)", calendarfielddate=56, calendarviewmode=month, calendarstickypopup=y, wiki=trackerCalendrierFormation, calendarviewnavbar=n, calendardelta=month, wiki=trackerFormationCalendrier) /}
Example
http://dev.tiki.org/All+Bugs (see page source to see how the plugin is used to generate the report)
- This page no longer exists. Any other examples?
How to make columns larger via CSS
Add.field2 { width: 500px;}
Related
- To add data to the tracker via a form in a wiki page: PluginTracker
- To create a report in a wiki page: PluginTrackerFilter, PluginTrackerItemField, PluginTrackerStat
- And also PluginVote
- Pretty Tracker
- PluginR uses PluginTrackerList to use data from trackers within R scripts.