Loading...
 

Tracker Ajax Services

Some significant developments have taken place since tiki 6 to make development with trackers much easier.  tiki-ajax_services.php has been designed to create, update, and delete trackers, tracker fields, and tracker items.  This is a primer on the available services and how they can be used.

A jQuery plugin has been written for tiki 10 (trunk at time of writing) that is accessible in /lib/jquery_tiki/tiki-trackers.js and can be added to a php page after including tiki-setup.php like this:


TikiLib::lib('header')->add_jsfile('lib/jquery_tiki/tiki-trackers.js');

This above file sets many of the standards for how we can use tiki-ajaxservices.php, however it can be called directly, and is In many cases.



Methods

Methods found in tiki-trackers.js that enhance the ability to use trackers as an api for building applications:
 


Method Options

The method options used in the below functions are very similar, this is the description of them so it isn't repeated below:

  • trackerId: int, default = 0, optional if trackerName is set

  • trackerName: string, default = '', optional if trackerId is null or 0

  • itemId: int, if set to 0, default = 0, inputs return blank or blanks with defaults

  • byName: bool, default = false, if set to true field keys become field names and can use either trackerId or trackerName

  • defaults: object, default = {}, if set key = field key, value = default value for a new item/itemId (0)


Method: $.tracker_get_item_inputs(options, callBackFunction);

Description: Gets the tracker value in their field inputs in an array, each value being html that should be wrapped in another html element (ie td, div, span) where the key of the object is the fieldId or fieldName (depending if the byName option is set to true).  The input names are set to what is expected from

Options:


  • trackerId
     
  • trackerName
     
  • itemId
     
  • byName
     
  • defaults

Example 1:



var inputs = {};

$.tracker_get_item_inputs({

 trackerId: 1,

 defaults: {

  '1':'Foo', //1 is the id of a field

  '2':'Foo 2' //2 is the id of a field

 }, function(o) {

  inputs = o;

});


Example 2:



var inputs = {};

$.tracker_get_item_inputs({

 trackerName: 'My Tracker',

 byName: true,

 defaults: {

  'Field 1':'Foo', //Field 1 is the name of a field

  'Field 2':'Foo 2' //2 is the name of a field

 }, function(o) {

  inputs = o;

});


Example 3:



var inputs = {};

$.tracker_get_item_inputs({

 trackerName: 'My Tracker',

 byName: true,

 itemId: 100 //if item id is set, then the inputs are populated with the values from that tracker item's field's values

}, function(o) {

  inputs = o;

});


Method: $.fn.tracker_get_inputs_from_form();

Description: Gets the fields from the form they have been added to.

Example:



var inputs = $('form').tracker_get_inputs_from_form();


Method: $.fn.tracker_insert_item(options, callBackFunction);


Description: Inserts a new item into a tracker from a form that has inputs appended from $.tracker_get_item_inputs and afterward performs a callback.

Options:


  • trackerId

  • trackerName

  • byName

  • fields

Example:



$('form').tracker_insert_item({

 trackerId: 5,

 fields: $('form').tracker_get_inputs_from_form()

}, function(trackerInfo) {

 document.location = document.location + '';

});


Method: $.fn.tracker_remove_item(options, callBackFunction);

Description: removes/deletes an item from a tracker

Options:

  • trackerId

  • trackerName

  • itemId


Method: $.fn.tracker_update_item(options, callBackFunction);

Description: Updates a tracker item's fields

Options:


  • trackerId
     
  • trackerName

  • itemId
     
  • byName

  • fields

Example:



$('form').tracker_insert_item({

 trackerName: 'My Tracker',

 byName: true,

 itemId: 100,

 fields: $('form').tracker_get_inputs_from_form()

}, function(trackerInfo) {

 document.location = document.location + '';

});

 

Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Diagram
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw -superseded by Diagram
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Kanban
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend
Terms and Conditions
Theme
TikiTests
Federated Timesheets
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools