Index by: file name | procedure name | procedure call | annotation

admin.tcl Annotations

Created from /home/groups/y/ya/yaacs/svnrepo/yaacs/admin.tcl
Procedure Summary
::admin::build_history { db proj proj_table }
          get a project contacts' history into an array whose keys are contacts' rid.
::admin::clearCache { }
          clear cached values for project's
::admin::countStateForOp { db idPj op state }
          countStateForOp - counts how many contacts has been marked with a specifed state(s) by an
::admin::delPj { db idPj }
          
::admin::delPjReal { db idPj }
          delete a
::admin::delTurn { db idT }
          delete a
::admin::flushStat { db idPj }
          flush stat for a project: move data from statistiche to
::admin::getAllPjOss { db pj }
          Get a project start-end timestamp to use as performance osservation
::admin::getDataPj { db idPj }
          get all project's attribute.
::admin::getFieldLIst { db schema tab }
          getFieldList - gives you back two list of field/type of table
::admin::getIdtByTName { db idt }
          get turn/shift name bi turn
::admin::getOperators { db idPj }
          getOperators - get a list of all operators which have been involved into a
::admin::getPjTurns { db pj date }
          get project's turns for a specified
::admin::getSamples { db }
          get all sampling algorithm
::admin::getSmsTxt { db proj }
          
::admin::getStatTable { db idPj }
          get project statistics table's
::admin::getTurns { db }
          get all turns defined on
::admin::importFile { db idPj slist path }
          importFile - import file into table pj
::admin::importSampleStructure { db idPj path }
          import the sampling structure from a specified formatted
::admin::massFax { db pj faxserver cover }
          do a massive fax send to all contacts of a specified
::admin::massMail { db pj mailserver fromadd path }
          do a massive mail send to all contacts of a specified
::admin::newUpPj { ce db name desc duration wtime active is4company {maxt samplet} soglia pausep freqmon table url shiftDef impS g_stuff {idPj {}} }
          create/edit a new cati
::admin::newUpTurn { ce db name start end {idT {}} }
          create/edit a
::admin::quotaCheck { db idPj type qPerc {deflist {}} }
          perform quota checking; you can choose between 2 types of them setting the type
::admin::quotaCodCol { db idPj type }
          quota checking for Stratified
::admin::quotaCodColS { db idPj type }
          quota checking for Cod col -
::admin::quotaCodProv { db idPj type qPerc }
          quota checking for
::admin::quotaGenAge { db idPj deflist }
          quotaGendAge checking for gender and
::admin::quotaRuotato { db idPj type }
          quota checking for
::admin::quotaSost { db idPj type }
          quota checking for
::admin::refreshOldContact { db idPj pjname oldM newM }
          
::admin::setLia { db pj email invite sms fax }
          ::admin::setLia update lia data for a given
::admin::setPjDuration { db pj start end }
          set a project
::admin::setTurns { db pj turns }
          set turns for a
::admin::summarize { db idPj {fromHere {}} {toHere {}} }
          summarize the project status calculating some
::admin::timeSpent { db idPj op }
          get the time a user has spent on a
::admin::turnTime { db idPj op start end }
          get the time a user has spent for a project in a specific work turn starting from start and ending not after

Procedure Detail

::admin::build_history

proc ::admin::build_history { db proj proj_table }
get a project contacts' history into an array whose keys are contacts' rid. Each array element is an array with these keys: cod_com, uid, login, ts, ouid, name.
Defined in:
admin.tcl, line 1766

::admin::clearCache

proc ::admin::clearCache {  }
clear cached values for project's parameters
Defined in:
admin.tcl, line 67

::admin::countStateForOp

proc ::admin::countStateForOp { db idPj op state }
countStateForOp - counts how many contacts has been marked with a specifed state(s) by an operator.
Parameters:
db - (operators) database connection handler
idPj - project's id
op - operator's id
state - state you want to match
Returns:
how many contacts has been classified as 'state' from operators op in project idPj
Defined in:
admin.tcl, line 1627

::admin::delPj

proc ::admin::delPj { db idPj }
Defined in:
admin.tcl, line 663

::admin::delPjReal

proc ::admin::delPjReal { db idPj }
delete a project
Parameters:
db - database connection handler
idPj - project's id on db.
Returns:
return 0 on success, -1 on generic error, ERR_IDREQ for null project's id.
Defined in:
admin.tcl, line 687

::admin::delTurn

proc ::admin::delTurn { db idT }
delete a turn
Parameters:
db - database connection handler
idT - turn's id on db.
Returns:
return 0 on success, -1 on generic error, ERR_IDREQ for null turn's id.
Defined in:
admin.tcl, line 964

::admin::flushStat

proc ::admin::flushStat { db idPj }
flush stat for a project: move data from statistiche to storico_statistiche.
Parameters:
db - (operators) database connection handler
idPj - project's id on db
Returns:
Return 0 on success, -1 on generic error. Return ERR_IDREQ for invalid project's id.
Defined in:
admin.tcl, line 983

::admin::getAllPjOss

proc ::admin::getAllPjOss { db pj }
Get a project start-end timestamp to use as performance osservation period.
Parameters:
(sample) - db database connectoin handler
pj - project's id return a two timestamps (start and end) list; -1 on error.
Defined in:
admin.tcl, line 1363

::admin::getDataPj

proc ::admin::getDataPj { db idPj }
get all project's attribute. try to use cached value if possible.
Parameters:
db - database connection handler
idPj - project's id on db
Returns:
attributes' list as specified by namespace vars; -1 on error.
Defined in:
admin.tcl, line 303

::admin::getFieldLIst

proc ::admin::getFieldLIst { db schema tab }
getFieldList - gives you back two list of field/type of table tab
Parameters:
db - - db connections handler (sample)
tab - - table whose yuo eant two know the list of fields
Returns:
a list of fields, -1 on error
Defined in:
admin.tcl, line 1639

::admin::getIdtByTName

proc ::admin::getIdtByTName { db idt }
get turn/shift name bi turn id
Defined in:
admin.tcl, line 744

::admin::getOperators

proc ::admin::getOperators { db idPj }
getOperators - get a list of all operators which have been involved into a project.
Parameters:
db - (operators) database connection handler
idPj - project's id on db
Returns:
ops list; -1 on error.
Defined in:
admin.tcl, line 338

::admin::getPjTurns

proc ::admin::getPjTurns { db pj date }
get project's turns for a specified date
Parameters:
db - (sampling) database connection handler
pj - project's id on db
date - the date for which you want to retrive informations
Returns:
return a list composed by a string with all turns' name setted for the specific date and the pos available; return -1 on error.
Defined in:
admin.tcl, line 806

::admin::getSamples

proc ::admin::getSamples { db }
get all sampling algorithm implemented
Parameters:
db - database connection handler
Returns:
array containing all sampling algorithm implemented. Each array element contains a list with the corresponding id, a description and the two aux tables' name. Return -1 on error.
Defined in:
admin.tcl, line 285

::admin::getSmsTxt

proc ::admin::getSmsTxt { db proj }
Defined in:
admin.tcl, line 1730

::admin::getStatTable

proc ::admin::getStatTable { db idPj }
get project statistics table's name
Parameters:
db - database connection handler
idPj - project's id on db
Returns:
stat table's name or -1 on generic error. If data ara available on multiple tables ERR_STAT will be returned.
Defined in:
admin.tcl, line 80

::admin::getTurns

proc ::admin::getTurns { db }
get all turns defined on db
Parameters:
db - database connection handler
Returns:
list of all turns; each elements is a list itself containing all turn's property. Return -1 on error.
Defined in:
admin.tcl, line 777

::admin::importFile

proc ::admin::importFile { db idPj slist path }
importFile - import file into table pj projects
Parameters:
db - - db connection handler
idPj - - project id
slist - - field list to import
path - - file where contatcs are stored
Returns:
0 on success, -1 on db error, -2 on sanity check error
Defined in:
admin.tcl, line 1668

::admin::importSampleStructure

proc ::admin::importSampleStructure { db idPj path }
import the sampling structure from a specified formatted file
Parameters:
db - (sampling) database connection handler
idPj - project's id on db
path - file's path return 0 on success; -1 on error
Defined in:
admin.tcl, line 1321

::admin::massFax

proc ::admin::massFax { db pj faxserver cover }
do a massive fax send to all contacts of a specified project
Parameters:
db - (sampling) database connection handler
pj - project's id on db
faxserver - server to be used to send faxes
cover - fax template
Returns:
Return 1 on complete success, 0 if some contacts has failed; -1 on error
Defined in:
admin.tcl, line 120

::admin::massMail

proc ::admin::massMail { db pj mailserver fromadd path }
do a massive mail send to all contacts of a specified project
Parameters:
db - (sampling) database connection handler
pj - project's id on db
mailserver - server to be used to send emails
fromadd - from email address
path - mail's body file path
Returns:
Return 1 on complete success, 0 if some contacts has failed; -1 on error
Defined in:
admin.tcl, line 197

::admin::newUpPj

proc ::admin::newUpPj { ce db name desc duration wtime active is4company {maxt samplet} soglia pausep freqmon table url shiftDef impS g_stuff {idPj {}} }
create/edit a new cati project
Parameters:
ce - choose if you want to create (0) or edit (1) a project
db - database connection handler
dbInt - operators' database connection handler
name - survey project's name
desc - survey project's description
duration - when does this project start/end? (two dates list)
wtime - list which specifies how long do you have to wait for a call back for no answer, busy, fax machine and answering machine respectively. (times are expressed in minutes)
active - flag which says if the project is running (!0) or not (0)
is4company - flag which says if the project's refered to company (!0) or not (0)
maxt - max numeber re-calling times
samplet - sample type expressed by an integer which unique identify the algorithm you want to apply
soglia - used for a specific type of sample
pausep - pause's params; a two elements list reporting max minutes for a pause duration and for their sum
freqmon - monitoring update frequence
table - default setted to name; db's table name to store project's data
url - default setted to ""; url to point a browser to do the survey
shiftDef - a messed list of list, each sublist contains turns id, day, seats smstxt, updatelist and massSms, action
impS - file and file's structured where contacts are stored
g_stuff - a list of 4 params that affect operator's GUI (1st show contact name, 2nd mandatory callback anagraphic data, 3rd mandatory anagraphic data on completed and 4th auto call definition: 0 no auto call, 1 auto call always on, 2 user selectable
idPj - [optional] project's id on db; use it if you're editing a project.
Returns:
return 0 on success, -1 on generic error, ERR_UNAME for not unique (or null) name, ERR_IDUR for an invalid duration, ERR_WTIME for error caused by wtime's value, ERR_SAMPLE for error caused by a bad samplet, ERR_PAUSE for bad pausep. ERR_FLAG is returned if you try to call newUpPj with a wrong ce flag; remember that if you're editing a project you've to supply a project's id or you'll get an ERR_IDREQ.
Defined in:
admin.tcl, line 416

::admin::newUpTurn

proc ::admin::newUpTurn { ce db name start end {idT {}} }
create/edit a turn
Parameters:
ce - choose if you want to create (0) or edit (1) a turn
db - database connection handler
name - turn's name
start - turn's start (time without time zone)
end - turn's end (time without time zone)
idT - [optional] turn's id on db. Use it to edit a turn.
Returns:
return 0 on success, -1 on generic error, ERR_UNAME for not unique or null name, ERR_IDUR for invalid turn duration. If you set ce to somewhat other than its legal values you'll get an ERR_FLAG. Remember that if you're editing a turn you must supply its id otherwise an ERR_IDREQ will be raised.
Defined in:
admin.tcl, line 897

::admin::quotaCheck

proc ::admin::quotaCheck { db idPj type qPerc {deflist {}} }
perform quota checking; you can choose between 2 types of them setting the type parameter.
Parameters:
db - database connection handler
idPj - project's id on db.
type - integer that specify the type of quota checking to perform;you can choose from: 0: stands x geographical quota (completed interviews) 1: stands x geographical quota (distance from goal) 2: stands x gender-age quota
quota - output parameter. it's a list which contains results.
Returns:
return a list which contains results otherwise: -1 for a generic error ERR_BADT on wrong quota type.
Defined in:
admin.tcl, line 1029

::admin::quotaCodCol

proc ::admin::quotaCodCol { db idPj type }
quota checking for Stratified sample
Parameters:
db - database connection handler
idPj - project's id on db.
type - integer that specify if yuo want numerosita' or distanza dall'obiettivo.
Returns:
quota list, -1 on generic error.
Defined in:
admin.tcl, line 1217

::admin::quotaCodColS

proc ::admin::quotaCodColS { db idPj type }
quota checking for Cod col - soglia
Parameters:
db - database connection handler
idPj - project's id on db.
type - integer that specify if yuo want numerosita' or distanza dall'obiettivo.
Returns:
quota list, -1 on generic error.
Defined in:
admin.tcl, line 1285

::admin::quotaCodProv

proc ::admin::quotaCodProv { db idPj type qPerc }
quota checking for cod_prov-capoluo
Parameters:
db - database connection handler
idPj - project's id on db.
type - integer that specify if yuo want numerosita' or distanza dall'obiettivo.
Returns:
quota list, -1 on generic error.
Defined in:
admin.tcl, line 1137

::admin::quotaGenAge

proc ::admin::quotaGenAge { db idPj deflist }
quotaGendAge checking for gender and age
Parameters:
db - database connection handler
idPj - project's id on db.
Returns:
quota list, -1 on generic error.
Defined in:
admin.tcl, line 1106

::admin::quotaRuotato

proc ::admin::quotaRuotato { db idPj type }
quota checking for ruotato
Parameters:
db - database connection handler
idPj - project's id on db.
type - integer that specify if yuo want numerosita' or distanza dall'obiettivo.
Returns:
quota list, -1 on generic error.
Defined in:
admin.tcl, line 1184

::admin::quotaSost

proc ::admin::quotaSost { db idPj type }
quota checking for sostituzione
Parameters:
db - database connection handler
idPj - project's id on db.
type - integer that specify if yuo want numerosita' or distanza dall'obiettivo.
Returns:
quota list, -1 on generic error.
Defined in:
admin.tcl, line 1252

::admin::refreshOldContact

proc ::admin::refreshOldContact { db idPj pjname oldM newM }
Defined in:
admin.tcl, line 656

::admin::setLia

proc ::admin::setLia { db pj email invite sms fax }
::admin::setLia update lia data for a given project
Parameters:
db - database connection handler
pj - the project you're working on
email - email template data
invite - panel invite template data
sms - sms template data
fax - fax template data
return - 0 on success; -1 on error.
Defined in:
admin.tcl, line 1744

::admin::setPjDuration

proc ::admin::setPjDuration { db pj start end }
set a project duration
Parameters:
db - database connection handler
pj - project's id on db
start - start date
end - end date
Returns:
returns 0 on success, -1 on error
Defined in:
admin.tcl, line 756

::admin::setTurns

proc ::admin::setTurns { db pj turns }
set turns for a project
Parameters:
db - (sampling) database connection handler
pj - project's id on db
turns - list of all turns to be saved. Each element of the list is it self a three elements list composed by {date,turns' id, pos}
Returns:
Return 0 on success; -1 on error
Defined in:
admin.tcl, line 844

::admin::summarize

proc ::admin::summarize { db idPj {fromHere {}} {toHere {}} }
summarize the project status calculating some indexes.
Parameters:
db - - database connection handler
idPj - project's id on db.
fromHere - [optional] where do you want to start to calculate performance indexes?
toHere - [optional] where do you want to stop to calculate performance indexes?
Returns:
indexs' list, -1 on generic error. The result list's composed as below: - # completed quests - # left quests - # unused contacts - # call backs - list of four performance indexes respectively for completed, refused, call backs and others - list of mean performance indexes.
Defined in:
admin.tcl, line 1405

::admin::timeSpent

proc ::admin::timeSpent { db idPj op }
get the time a user has spent on a project
Parameters:
db - operators database connection handler
idPj - project's id
op - which operator are you going to "process"
Returns:
time amounts; -1 on error.
Defined in:
admin.tcl, line 1554

::admin::turnTime

proc ::admin::turnTime { db idPj op start end }
get the time a user has spent for a project in a specific work turn starting from start and ending not after end.
Parameters:
db - operators database connection handler
idPj - project's id on db
op - which operator are you looking for?
start - when does this turn start?
end - upper limit for turn ending (i.e. the next turn's start)
Returns:
time amount for the turn; -1 on error.
Defined in:
admin.tcl, line 1513

Index by: file name | procedure name | procedure call | annotation
File generated 2008-03-25 at 02:51.