Class Profile
Methods for fetching info about a users profile.
Syntax
Constructors
Profile()
Initializes a new instance of the Profile class.
Declaration
Profile
Methods
getListTicketsFields(Integer)
Deprecated from version 7!
Returns an array containing information about a user's profile for the list-tickets tables asheaderField, databaseField, chop, headerField, databaseField, chop, ...
Declaration
String[] getListTicketsFields(Integer user)
Parameters
Type | Name | Description |
---|---|---|
Integer | user | The user to get a profile for. |
Returns
Type | Description |
---|---|
String[] | Information about a user's profile for the list-tickets tables in a SearchEngine- and DataTable-friendly way. |
Examples
Example for use in the construction script for the Screen Element DataTable:
Map config = getScreenElementConfig(screenElementIndex);
Profile p;
String[] fields = p.getListTicketsFields(getVariable("activeUser").toInteger());
Integer c = 0;
for (Integer i = 0; i < (fields.length()* 2); i = i+3)
{
config.insert("fields." + c.toString() + ".label", fields[i]);
config.insert("fields." + c.toString() + ".field", fields[i+1]);
config.insert("fields." + c.toString() + ".chop", fields[i+2]);
if (fields[i+1] == "ticket.status" || fields[i+1] == "ticket.ticket_status")
{
config.insert("showTicketStatus", "true");
}
c++;
}
config.insert("fields.length", c.toString());
config.insert("criteria.0.field", "ticket.ticket_status.(ticket_status_lang->ticket_status).language");
config.insert("criteria.0.operator", "OperatorEquals");
config.insert("criteria.0.value", getVariable("userLang"));
config.insert("criteria.length", "1");
When using this function with a DataTable, it is important to add a criteria for which language the user has:
config.insert("criteria.0.field", "ticket.ticket_status.(ticket_status_lang->ticket_status).language");config.insert("criteria.0.operator", "OperatorEquals");config.insert("criteria.0.value", getVariable("userLang"));config.insert("criteria.length", "1");