Integra Framework v5

FunctionDescriptionExample

UC_exec

(sqlquery,dsn,callback)

Executes SQL query on the database (INSERT, UPDATE, DELETE), can or cannot have a callback.

sqlquery: INSERT UPDATE or DELETE.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.

UC_exec
UC_exec("INSERT INTO ccrepo.DC_Telefono VALUES ('" + nombreAgente+ "','" + $("#telefono").val() + "','" + fecha + "') ON DUPLICATE KEY UPDATE proximo_contacto = '" + fecha + "'","",respsaveproxcontacto);

UC_Save

(object,table,dsn,callback)

Saves an object of a table in the database.

object: Javascript object to save (identical to destination table).

table: Name of the destination table.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.



UC_Save
UC_Save(ArrayOfVentas[i], 'DC_Venta', '', callbackGuardarVenta);

UC_fullSelect

(solochosen,idSelect,objetoSelect, chosen,atributo,parse)

Fills a comboBox or listBox with data from a query.

solochosen: If this parameter is 0 initialize the chosen with the objects passed in objetoSelect. If 1 use the html values and initlize with .chosen().

idSelect: Id of the html (out comboBox).

objetoSelect: List of values or objects:

Example values: ["ACOMP-BLESS->","campanaParaTestBeto<-"]

Example objects: [{"departamento":"ARTIGAS"},{"departamento":"CANELONES"}]

chosen: If 1 the function .chosen() is applied initialize the comboBox,if 0 loads the html of the select with options of objetoSelect but doesnt apply .chosen(), does not initialize.

attribute: If specified an attibute means that the objetoSelect has the form of a list of objects so the values displayed on our control is the content of the name of that attribute. Example 'departamento' to fill with ARTIGAS, CANELONES.

parse: If 1 JSON.parse is applied to objetoSelect asumes is passed as a String, if 0 assumes that in an array of values or array of objects.

 

solochosenchosenresult
00ListBox using objetoSelect values
10ListBox using html values
11ComboBox using html values
01ComboBox using objetoSelect values

 

 

UC_fullSelect
UC_fullSelect(0,"campanasCodigos",campañas,1,null,1);

UC_fullTable

(idTabla,datosParaLlenar, stringDatos,onSelected,scroll,dataFormat,bColum,bOrder,bfilter)

Puts all the data into the table.

idTabla: Id of the tag <table> in our html.

datosParaLlenar: List in String format used to load the table.

Example: [{"id":1,"documento":"","nombres":"Casanova Barreiro Rossana Haydee","departamento":""...

 stringDatos: Names of the filed that we want to show int our column table. Separated by coma (,).

onSelected: Function executed when you select a row of the table,has a parameter that returns the objet of the selected row.

Example: function metodoOnSelectedSample(resp){

//Resp has the object in string format as we pass in the datosParaLlenar

}

scroll: Height in pixels of the table. Ej: '100px'.

dataFormat: Format of the Dates so the table can order the datatype correct, example : 'MM/DD/YYYY'.

bColum, bOrder: This parameters are to order via a particular column asc or desc, passing as an integer the number of the column to order and if desc or asc.

Example:

Second column descendent: 1,"desc"

 

UC_fullTable
UC_fullTable("tablaCodigo",JSON.stringify(codigosHistorico),'Codigo,Detalle,Callerid,Documento,Resultado',selectCodigo,"300px","DD/MM/YYYY",0,"asc");

UC_addPagination

(idTabla)

Add pagination to a table.

This method adds two buttons, Previous and Next for pagination porpoises.

The user has to define the methods for the behavior of the buttons: the ids are idTabla_anterior, idTabla_siguiente.

Via javascript and jQuery:

$('#idTabla_anterior').click(function(){...});

and

$('#idTabla_siguiente').click(function(){...});

idTabla: Id of the html table.

UC_addPagination
UC_addPagination('tablaBusquedaBaseVentas');

UC_update

(json, tablename, column, dsn, callback)

Update Data.

json: Object with the new data.

tablename: Name of the table to update.

column: Name of the column to update from usually the table PK.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.


UC_update
UC_update(objetoRefActual, "DC_Referido", "idref", "", respUpdateReferido);

UC_delete

(tablename, column, value, valuetype, dsn, callback)

Deletes an object.

tablename: Name of the table to delete from.

column: Name of the column that we are going to make the delete usually the PK.

value: Value of the selected column to delete.

valuetype: Datatype of the value of the column to delete: int, string.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.


UC_delete
UC_delete('DC_Producto', 'id', productoseleccionado.id, 'int', '', callbackEliminar);

UC_get

(sqlquery,dsn,callback)

Get data from a SQL SELECT query.

sqlquery: SELECT sql.

dsn: Name of the data source, empty uses CCREPO Database.

callback: Null or name of the function to execute on completion.


UC_get
UC_get("SELECT * FROM DC_Param order by id asc","",callbackInitDocumento);

UC_makeCall

(campaign,source, destination,callback)

Makes a call.

campaign: Outbound campaign to compute this call to.

source: Oublound DID for this call (number seen by the client).

destination: Number to call.

callback: Null or name of the function to execute on completion.

UC_makeCall
UC_makeCall(campaign,source, destination,callback);

UC_hangUp

(callback)

Hangup the actual call.

callback: Null or name of the function to execute on completion.

UC_hangUp
UC_hangUp();

UC_pause

(boolean)

Pause or UnPause an agent without using BREAKS.

boolean: true or false.

UC_Pause
UC_Pause(true);

UC_sendSms

(phone,message)

Sends SMS.

phone: Destination.

message: Text.

UC_sendSms
 UC_sendSms(43525915,"Hello world!");

UC_sendMail

(fromname, to, subject, body)

Sends an Email.

fromname: Name of the From.

to: Destination email.

subject: Subject.

body: Text can be plain or html.

UC_sendMail
UC_sendMail(clienteseleccionado.campana, $('#txtEmailGestion').val(), $('#txtDatoGestion').val(), $('#txtComentarios').val());

UC_getAgents

(callback)

Get agents in the callback in json format.

UC_getAgents
UC_getAgents(setAgents);

UC_getSystemCampaigns

(callback)

Get campaings in the callback in json format.

UC_getSystemCampaigns
UC_getSystemCampaigns(setComboCampaigns);

UC_getMyAgentCampaigns

(callback)

Get agents of my campaings in the callback in json format.

UC_getMyAgentCampaigns
UC_getMyAgentCampaigns(respGetAgentCampaigns);

UC_getMySuperCampaigns

(callback)

Get campaigns if Im a supervisor in the callback in json format.

UC_getMySuperCampaigns
 UC_getMySuperCampaigns(callback);

UC_getAgentForCampaign

(campaign,callback)

Get agents of an specific campaign in the callback in json format.

UC_getAgentForCampaign
 UC_getAgentForCampaign(campaign,callback);

UC_subirArchivoCSV

(archivo, tabla,sentence,callback)

Upload a CSV file to a database table.

archivo: Obtained from an upload

tabla: Destination table.

sentence: If changes are required (check MYSQL LOAD IN FILE syntax).

callback: Null or name of the function to execute on completion, returns the result.

UC_subirArchivoCSV
UC_subirArchivoCSV(archivo, "DC_Telefono","IGNORE 1 LINES (agente,telefono)\n",respUploadCodigoCSV);

UC_generateReport

(jsonReport,html,excel,pdf,doc)

Generates and download a report excel, pdf, doc,txt, cvs.

jsonReport: The object with the following format:

Object Report
{"name":"Breaks Totales", //name of the report 
"file":"TiemposPausaBreakePorAgente.jrxml", //  jrxml file
"description":"Breaks Totales", //description
"dsn":"Repo", // data source name
"parameters":"INITIAL_DATE=Timestamp=2015-11-03 00:00:00;FINAL_DATE=Timestamp=2015-11-03 3:59:59;REPORT_LOCALE=Locale=es;AGENT=Agent='Admin',,'Agente1','Agente10','Agente11',",
//report parameters type and value for generation.
"grouped":"Agentes", //group
"language":"es", //language
"license":"CCS"}

html, excel, pdf, doc: this parameters are 1 o 0, when 1 is downloaded in the following format. (excel 2 is a csv) (doc in 2 is txt)

 

UC_generateReport
UC_generateReport(objetoReporte,0,2,0,0);

UC_closeForm

Close actual Form.
UC_closeForm
UC_closeForm();

UC_ShowXForm

Shows X button on Form Tab.
UC_ShowXForm
UC_ShowXForm(); 

UC_setChannelVariable

(variable, value, callback)

Sets a variable to an active call.

variable:Name of the value.

value: Value.

callback: Returns.

UC_setChannelVariable
UC_setChannelVariable('nombre','pepe',null);

UC_TagRecord

(guid, data) 

Tag a recording so we can search for that value on Recordings.

guid: Id of the call from CTI object.

data: Text to tag it.

UC_TagRecord
 UC_TagRecord(guid, "data");

UC_respool

(objetoRespool, callback)

Respool for a Dialer call when you havent reach the client you wanted. is possible to add the next phone of the contact to the dialer altough was an answered call.

 objetoRespool: Object of the type UC_DialerObject (check function).

callback: Response of the function.


UC_Respool
 UC_respool(objetoRespool, callback);

UC_DialerObject

(dialer)

Returns an object type calls_spool (dialer table), so we can make a respool or dialer schedule.

dialer: String of the attribute Dialer in the CTI object.

UC_DialerObject
UC_DialerObject(CTI.Dialer);

UC_replaceAll

(str, find, replace)

Replace all occurrences of a string.

str: Original String.

find: String to find.

replace: What to replace with.

Returns changed String.

UC_replaceAll
 UC_replaceAll("Hello world","world","how are you?");

UC_generateNamedReport

(jsonReport, html, excel, pdf, doc, name)

Generates and download a report excel, pdf, doc,txt, cvs. but with a determinated name (not a guid).

jsonReport: The object with the following format:

Object Report
{"name":"Breaks Totales", //name of the report 
"file":"TiemposPausaBreakePorAgente.jrxml", //  jrxml file
"description":"Breaks Totales", //description
"dsn":"Repo", // data source name
"parameters":"INITIAL_DATE=Timestamp=2015-11-03 00:00:00;FINAL_DATE=Timestamp=2015-11-03 3:59:59;REPORT_LOCALE=Locale=es;AGENT=Agent='Admin',,'Agente1','Agente10','Agente11',",
//report parameters type and value for generation.
"grouped":"Agentes", //group
"language":"es", //language
"license":"CCS"}

html, excel, pdf, doc: This parameters are 1 o 0, when 1 is downloaded in the following format. (excel 2 is a csv) (doc in 2 is txt).

name: Name of the file to download.

UC_generateNamedReport
UC_generateNamedReport(objetoReporte,0,2,0,0,"nombreReport");

UC_DialerSchedule

(callDate, objectDialer, callback)

Schedule a call for a Dialer in a determinated date for a campaign and destination.

callDate: Datetime for the schedule call.

objetDialer: Object UC_DialerObject with the Dialer String of the CTI object ,

callback: Response of the function.


UC_DialerSchedule
UC_DialerSchedule(objetoScheudle, callbackDialerSchedule);

notification

(title, message, icon, type)

Shows a message to the user.

title: Title of the notification.

message: Message of the notification.

icon: Fontawesome string for icon.

Example:"fa fa-times"(error),"fa fa-check"(success),"fa fa-warning"(warning)

type: Type of the notification.

-Example:"danger"(error),"success"(success),"warning"(warning)

notification
notification("Error","Must enter the name","fa fa-times","danger");

UC_audit

(audit)

Audits actions of the user.

Adds a record to ccrepo.auditory with user and IP.

UC_audit
UC_audit('The user successfully logging');

UC_goToTab

(idTabPane)

Go to other tab of the Form.

idTabPane: Tab-pane id we want to show.

UC_goToTab
UC_goToTab("Ventas");

UC_generateGraphic

(idContenedor, datos, tipo,titulo, colores, tamano)

Genete charts.

idContenedor: If of the chart container.

datos: Array of the data for the chart.

tipo: Chart type if lineal null else pie, donut, bars.

titulo: Title for a donut chart else null.

colores: Array of colors in hexadecimal (['#2334','#45454']).

tamaño: Size in pixels of the chart ('240px') else null takes the size of the container.

var arrayDatos= [['data1', 30],['data2', 120]];
UC_generateGraphic("idContenedor",arrayDatos,"pie",null,null);
 
var arrayDatosLineas=[
	 ['data1', 30, 200, 100, 400, 150, 250],
	 ['data2', 50, 20, 10, 40, 15, 25]
];
UC_generateGraphic("idContenedor",arrayDatosLineas,null,null,null);
UC_ExecPost

(url, data, callback)


Executes a POST webService from our domain.

url: Pass the url of the web service .

data: If the web service expects parameters, you must pass on data. 

calback : Return.

UC_ExecPost
UC_ExecPost(url, data, callback);
UC_GM_LoadActions

(measure, actions, callback)

Executes a Gamification WebService that allows to add points to the agent.

measure: Name of the measure

actions: Ammount of actions to credit (it will be multiplied with the measure to calculate the points)

callback: Return.

UC_GM_LoadActions
UC_GM_LoadActions('measureName', 100, callback);