[Show/Hide Right Column]

Create a form to filter tracker fields
Print

Plugin TrackerFilter

Introduced with Tiki 1.9.5

Purpose

To give an interface to filter a tracker's items by filtering some fields.

Syntax

example
{TRACKERFILTER(trackerId=1, filters=1/d:2/r:3, fields=1:4:5)}This is the result{TRACKERFILTER}

Parameters:

  • trackerId: Id of the tracker
  • filters is the list of fields that can be filtered with the format of their display.
    The fields are identified by their numeric Ids. All the fields must belong to the same tracker.
    The Id can be followed by the character / and one of this format:
    • d: drop down list of all the values occurring for the field: only one value can be selected
    • r: radio buttons of all the values occurring for the field: only one value can be selected
    • m: multiple choice in the drop down list of all the values occurring for the field( a multiple choice acts as an OR between the values of the choice)
    • c: checkbox (multiple choice) in the drop down list of all the values occurring for the field
    • t: text entry (tikiwiki >= 2.0): a text input where the user must enter a part of the text
      If the text contains % like a%. it will search all the values beginning with % (can also do %a or a%b%c) or a* or *a
    • T: text entry (tikiwiki >= 2.0): a text input where the user must enter an exact value of the field
    • i: text entry + initial (tikiwiki >=2.0): a list of initial that will directly filtetr on an initial. Note: if you use initial, not other field can be filtered
    • sqlsearch: advanced mysql search (tikiwiki >= 5.0): a list of fields where a mysql advanced search will be done - Note: the search is done field content per field content: It means if you query A B and A is in a field and B in another one you will not find the item. The syntax will be (1:2)/sqlsearch means 'do a advanced mysqlsearch on fields 1 and 2.
    • > or < or >= or <=: comparaison (tw >=6.0): the field will be compared using the format as operator. Ex: filters="1/>=" will find all the items with the field 1 bigger (for a numeric) or after (for a date) the value the user will give
  • fields will show the fields displayed for the selected items
  • action : name of the submit button - default filter (tw >= 1.9.8)
  • all the params of the tracker TRACKERLIST can be added to customize the look of the result (except the filterfield, exactvalue and filtervalue - that will overwrite the filter selection) Some are inetersting
    • goIfOne: go directly to the item display (tiki-view_tracker_item.php) if only one item is found (tikiwiki >= 1.9.8)
    • displayList: y or n to display the full list of items before the first filtering (default: n that displays only the filter the first time)
    • line: y or n to display all the filters on the same line (default n)
  • noflipflop: Will not show the flipflop to hide and display the list of filters. (tw >=6.0)
  • export_action: (tikiwiki >= 6.0) if set to appropriate text e.g."Confirm CSV Download" this over-rides the normal trackerfilter approach and displays a button with the designated text that directly exports the set of fields specified as a CSV file. A filter to define a specific 'filter set' must be defined by using the filterfield, filtervalue/exactvalue parameters, formatted in the standard ways. Additional parameter options are (default|alternate):
    • export_itemid=y|n - includes the ItemId in the export
    • export_status=n|y - includes the status field in the export
    • export_modif=n|y - includes the modified date in the export
    • export_created=n|y - includes the creation date in the export
    • export_charset=UTF-8|ISO-8859-1 - defines the character set to be used for the export

The plugin data will be displayed at the top of the results (tikiwiki >=1.9.8)

example
{TRACKERFILTER(filters=1/d:2/r:3:(4:5)/sqlsearch, fields=1:4:5, showtitle=n, showlinks=y, showdesc=n, showinitials=n, showstatus=n, status=opc, sort_mode=f_1_asc)}{TRACKERFILTER}

It can be interesting to use the checkbox capacity of trackerlist to do some action on some filtered items

example
{TRACKERFILTER(filters=82/d:84, fields=82:83, checkbox=85/to/Email to checked/send/soho-send_message.php/soho-send_message.tpl)}

You can also get directly connected to the message box

example
{TRACKERFILTER(filters=82/m:84, fields=82:83, checkbox=85/to/Email to checked/xxx/messu-compose.php) /}

Restrictions

For the moment, the trackerfilter plugin works with the following field types:

  • category - e
  • drop-down list - d
  • email - m
  • text field - t
  • textarea - a
  • numeric field - n
  • country - y
  • user
  • group

but not:

  • item list
  • item link

Note: For a drop-down list, the values of the drop down list will be displayed, For the other field types, the values found in the database will be displayed.

Description

Imagine a tracker

Image
A search page like this
{TRACKERFILTER(trackerId=1, filters=5:6:9:8/d:(2:1:3)/sqlsearch, showlinks=y, fields=5:2:1, wiki="tracker ideas") /}
The page will look like
Image

and when you click on filter you will have something like this

Image

more

  • a checbox value is 'y' or 'n' in tw >=2.0 (some bugs were around before tw<2 that insert checkbox values as yes, no, on, or empty- please clen your database if problem)

Contributors to this page: lindon2331 points  , xavi36278 points  , sylvie4333 points  , Marc Laporte5511 points  , Jean-Marc Libs879 points  , Jürgen Heckes471 points  , Geoff Brickell625 points  , David Leasure13 points  and ChadDa3mon3 points  .
Page last modified on Sunday 08 August, 2010 15:06:49 UTC by lindon2331 points .

Find by Page Name

Exact match

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki documentation and should correspond to development keywords (bug reports and feature requests):