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

op.tcl Annotations

Created from /home/groups/y/ya/yaacs/svnrepo/yaacs/op.tcl
Procedure Summary
::op::addIntType { db newType }
          Create a new operator
::op::briefHandler { db_handler uid proj }
          briefHandler: retrive briefing time and if, for the specific op, this can be paid or not based on payments informations prepared and stored at proj
::op::check_block { db proj uid start end }
          ## check_block check for broken pause during
::op::checkLogin { db login }
          Check if a login could be assigned without breaking the unique constraint on
::op::cmdAddUser { user pwd }
          ::op::cmdAddUser - produce a shell command to be execute on a remote machine
::op::cmdDelUser { user }
          ::op::cmdDelUser - produce a shell command to be execute on a remote machine
::op::cmdNisUp { }
          ::op::cmdNisUp - produce a shell command to be execute on a remote machine (nis
::op::cmdResetPwd { user }
          
::op::cross_project { db proj uid s_start s_end where }
          ## cross_project check for cross project work did by
::op::cryptPwd { pwd }
          crypt(3) a clear text password actually crypt(3) man page say that it use DES algorithm, but seems tha it's quite different from the one used by tcllib des
::op::delIntType { db id }
          
::op::delOp { db cod }
          remove an operator from the
::op::enqueueSms { db login cell text }
          Put an 'single' sms to its
::op::genPwd { plen }
          generate a random
::op::getFilteredInfos { db field filter }
          get all op's 'field' stored on db filtered as you
::op::getInfos { db field {distinct 0} }
          get all op's 'field' stored on
::op::getIntTypes { db }
          Get operators' available
::op::getOp { db cod }
          get operator
::op::getOpAdvice { db uid }
          get supervisor advice to the
::op::getOpBank { db cod }
          get operator bank account
::op::getOpById { db id }
          get operator data using user's
::op::getOpByLogin { db login }
          get operator data using user's
::op::getOpDisp { db cod }
          get operator availability
::op::getPicture { db uid picname }
          get a user's picture to let a supervisor really knows who he/she
::op::getPjDates { db proj }
          # getPjDates provide start and end date of a
::op::getRecruitment { db id }
          Get a recruitment's
::op::getSmsTxt { db proj }
          
::op::getUsyncNum { db }
          ::op::getUsyncNum - tells you how many users you have to create/delete @parma db - database connection
::op::hours_conv { db interval form }
          HOURS_CONV: to convert pgsql datatype 'interval' @parama db db connection; @interval string containing values in 'interval' format
::op::hours_counter { db_handler myData uid proj }
          
::op::linkablePjs { db }
          Get all linkable
::op::linkPjs { db user pjs }
          Set a user's projects on the
::op::massiveRecruitSms { db id txt }
          send massive sms for recruitment
::op::onPayments { db uid lProj ckTech }
          when an op is paid all record regarding the payments is marked as paid (so 'deactivated' from payable
::op::proj_calc { db_handler proj }
          proj_calc return the omnicomprehensive list of lists ::op::op_sum described
::op::recalc_brief { uid db_handler ckTech brfList briefNum totHoursDec }
          procedure recalc_brief refresh total minutes counted for breifing and training; and total money
::op::recalc_proj { op_sum trnArray projMoney briefTime db_handler }
          ##
::op::recruit { db id type morning afternoon evening smsTxt brief action }
          wrapper around op::recruit real just to guarantee transaction
::op::recruitReal { db id type morning afternoon evening smsTxt brief action }
          Get all operators suitable for the criteria supplied.
::op::resetPwd { login pwd rhost userto }
          
::op::RetriveProjs { db_handler uid all }
          Get projects where uid had worked
::op::saveOpData { db name surname address city cap phone1 phone2 cell email { bplace} bdate active notes points alt_addr alt_city alt_cap sex type code salary { bank} bank_addr bank_city bank_abi bank_cab bank_cc bank_owner morning afternoon { evening} availablefrom { login} context {mode 0} }
          Save operator data on
::op::setPicture { db uid picpath }
          set a user's picture to let a supervisor really knows who he/she
::op::sshRemoteBatch { host login passwd cmd }
          ::op::sshRemoteBatch - execute a cmd on a remote
::op::sshRemoteResPwd { host login passwd cmd pwdto }
          
::op::storePayments { db proj op_sum trnArray }
          ## store op's billing data in paymentslog
::op::syncUser { db login passwd host }
          ::op::syncUser - create / remove users on a remote
::op::uid_calc { db_handler uid lProj }
          
::op::updateIntType { db id type }
          
::op::updateOpNote { db op note {score {}} }
          update note field for a
::op::userPjs { db user }
          Get all user's

Procedure Detail

::op::addIntType

proc ::op::addIntType { db newType }
Create a new operator type.
Parameters:
db - (op) database connection handler
Returns:
return 0 on success; -1 on error.
Defined in:
op.tcl, line 554

::op::briefHandler

proc ::op::briefHandler { db_handler uid proj }
briefHandler: retrive briefing time and if, for the specific op, this can be paid or not based on payments informations prepared and stored at proj closing
Parameters:
db_handler - : db connection
uid - : op's ID
proj - : project's ID
Returns:
Return a list with these elements: 0 briefing time (decimal format) 1 a Flag for briefing attending (or not)
Defined in:
op.tcl, line 1497

::op::check_block

proc ::op::check_block { db proj uid start end }
## check_block check for broken pause during worksession
Parameters:
db - db connection;
proj - project ID;
uid - op's ID;
start - session start;
end - session end;
Returns:
Return 0 if any block is retrived, 1 otherwise
Defined in:
op.tcl, line 1214

::op::checkLogin

proc ::op::checkLogin { db login }
Check if a login could be assigned without breaking the unique constraint on it.
Parameters:
db - (op) database connection handler
login - the user name you wanna check
Returns:
0 if the login supplied can be used (i.e. is not currently used), -1 otherwise
Defined in:
op.tcl, line 261

::op::cmdAddUser

proc ::op::cmdAddUser { user pwd }
::op::cmdAddUser - produce a shell command to be execute on a remote machine (useradd)
Parameters:
user - - the user's login to create
Returns:
- a strin containing the command to execute
Defined in:
op.tcl, line 821

::op::cmdDelUser

proc ::op::cmdDelUser { user }
::op::cmdDelUser - produce a shell command to be execute on a remote machine (userdel)
Parameters:
user - - the user's login to delete
Returns:
- a strin containing the command to execute
Defined in:
op.tcl, line 834

::op::cmdNisUp

proc ::op::cmdNisUp {  }
::op::cmdNisUp - produce a shell command to be execute on a remote machine (nis update)
Returns:
- a strin containing the command to execute
Defined in:
op.tcl, line 845

::op::cmdResetPwd

proc ::op::cmdResetPwd { user }
Defined in:
op.tcl, line 853

::op::cross_project

proc ::op::cross_project { db proj uid s_start s_end where }
## cross_project check for cross project work did by ops
Parameters:
db - db connection;
proj - project ID;
uid - op's ID;
start - period analyzed start;
end - period analyzed end;
Returns:
Returns 0 if any crossproject event is retrived, 1 otherwise
Defined in:
op.tcl, line 1194

::op::cryptPwd

proc ::op::cryptPwd { pwd }
crypt(3) a clear text password actually crypt(3) man page say that it use DES algorithm, but seems tha it's quite different from the one used by tcllib des package
Parameters:
pwd - - a clear text string
Returns:
a list pwd ina a encrypted form
Defined in:
op.tcl, line 979

::op::delIntType

proc ::op::delIntType { db id }
Defined in:
op.tcl, line 562

::op::delOp

proc ::op::delOp { db cod }
remove an operator from the db
Parameters:
db - (op) database connection handler
cod - operator's code
Returns:
0 on success; -1 on error.
Defined in:
op.tcl, line 221

::op::enqueueSms

proc ::op::enqueueSms { db login cell text }
Put an 'single' sms to its spool
Parameters:
db - (op) database connection handler
login - receiver's login
cell - receiver's cell phone
text - message's text
Returns:
0 on success; -1 on error.
Defined in:
op.tcl, line 523

::op::genPwd

proc ::op::genPwd { plen }
generate a random pwd
Parameters:
plen - - password length @result - a plen chars long password
Defined in:
op.tcl, line 931

::op::getFilteredInfos

proc ::op::getFilteredInfos { db field filter }
get all op's 'field' stored on db filtered as you specify
Parameters:
db - (op) database connection handler
field - db column name you want to retrive
filter - sql filter to use
Returns:
list of all 'field' values stored on operators db; -1 on error.
Defined in:
op.tcl, line 184

::op::getInfos

proc ::op::getInfos { db field {distinct 0} }
get all op's 'field' stored on db
Parameters:
db - (op) database connection handler
field - db column name you want to retrive
distinct - flag to set if you want to have distinct values
Returns:
list of all 'field' values stored on operators db; -1 on error.
Defined in:
op.tcl, line 155

::op::getIntTypes

proc ::op::getIntTypes { db }
Get operators' available types
Parameters:
db - (op) database connection handler
Returns:
return an array containg the deseired informations; an empty array is returned on error.
Defined in:
op.tcl, line 539

::op::getOp

proc ::op::getOp { db cod }
get operator data
Parameters:
db - (op) database connection handler
cod - operator's cod. fisc. (it's a key)
Returns:
array with all operator db fields; an empty array is returned on error.
Defined in:
op.tcl, line 69

::op::getOpAdvice

proc ::op::getOpAdvice { db uid }
get supervisor advice to the operator
Parameters:
db - - db conn handler
uid - - user (operator) id
Returns:
a tring containing supervisor advice
Defined in:
op.tcl, line 205

::op::getOpBank

proc ::op::getOpBank { db cod }
get operator bank account data
Parameters:
db - (op) database connection handler
cod - operator's cod. fisc. (it's a key)
Returns:
array with all operator bank db fields; an empty array is returned on error.
Defined in:
op.tcl, line 132

::op::getOpById

proc ::op::getOpById { db id }
get operator data using user's id
Parameters:
db - (op) database connection handler
id - operator's id
Returns:
array with all operator db fields; an empty array is returned on error.
Defined in:
op.tcl, line 117

::op::getOpByLogin

proc ::op::getOpByLogin { db login }
get operator data using user's login
Parameters:
db - (op) database connection handler
login - operator's login
Returns:
array with all operator db fields; an empty array is returned on error.
Defined in:
op.tcl, line 101

::op::getOpDisp

proc ::op::getOpDisp { db cod }
get operator availability data
Parameters:
db - (op) database connection handler
cod - operator's cod. fisc. (it's a key)
Returns:
array with all operator availability db fields; an empty array is returned on error.
Defined in:
op.tcl, line 143

::op::getPicture

proc ::op::getPicture { db uid picname }
get a user's picture to let a supervisor really knows who he/she is.
Parameters:
db - database connection handler
uid - user's uid
picname - the name you want to use to refer to the image to be created.
Returns:
Returns 0 on success, -1 on error.
Defined in:
op.tcl, line 1632

::op::getPjDates

proc ::op::getPjDates { db proj }
# getPjDates provide start and end date of a project
Parameters:
db - db connection;
proj - project's ID
Returns:
Returns a list containing the two dates
Defined in:
op.tcl, line 1179

::op::getRecruitment

proc ::op::getRecruitment { db id }
Get a recruitment's data
Parameters:
db - database connection handler
id - project's id
Returns:
return an array with all rectuitment data; an empty array is returned on error.
Defined in:
op.tcl, line 294

::op::getSmsTxt

proc ::op::getSmsTxt { db proj }
Defined in:
op.tcl, line 1033

::op::getUsyncNum

proc ::op::getUsyncNum { db }
::op::getUsyncNum - tells you how many users you have to create/delete @parma db - database connection hanlder
Returns:
- the number of users, -1 on errors
Defined in:
op.tcl, line 741

::op::hours_conv

proc ::op::hours_conv { db interval form }
HOURS_CONV: to convert pgsql datatype 'interval' @parama db db connection; @interval string containing values in 'interval' format (i.e.: '1 day 19:35:45.23'); @form output format can be the common 'hh:mm' (1) or hours in decimal base (2)
Returns:
Returns the interval in the selected format.
Defined in:
op.tcl, line 1365

::op::hours_counter

proc ::op::hours_counter { db_handler myData uid proj }
Parameters:
db_handler - database connection
myData - date string in 'yyyy-mm-dd' format
uid - operator's id
proj - project id selected
Returns:
Returns a list containing start/end time, worked time and cross project flag for each op's worksession; -1 if op hasn't sessions that day.
Defined in:
op.tcl, line 1241

::op::linkablePjs

proc ::op::linkablePjs { db }
Get all linkable projects
Parameters:
db - (op) database connection handler
Returns:
a list of all projects' table names; -1 on error.
Defined in:
op.tcl, line 276

::op::linkPjs

proc ::op::linkPjs { db user pjs }
Set a user's projects on the db
Parameters:
db - (op) database connection handler
user - user's user
pjs - list of projects to link to the user
Returns:
0 on success; -1 on error.
Defined in:
op.tcl, line 482

::op::massiveRecruitSms

proc ::op::massiveRecruitSms { db id txt }
send massive sms for recruitment purpose
Parameters:
db - database connection handler
id - project's id
txt - sms's text
Returns:
returns 0 on success, -1 on error;
Defined in:
op.tcl, line 993

::op::onPayments

proc ::op::onPayments { db uid lProj ckTech }
when an op is paid all record regarding the payments is marked as paid (so 'deactivated' from payable projects)
Parameters:
db - db connection
uid - op's ID
lProj - a list containing paid projs ID
ckTech - techincal training flag
Returns:
Returns a value in the 'account window' waiting variable
Defined in:
op.tcl, line 1116

::op::proj_calc

proc ::op::proj_calc { db_handler proj }
proj_calc return the omnicomprehensive list of lists ::op::op_sum described below.
Parameters:
db_handler - a db connection;
proj - project's ID;
Returns:
Returns a list containing all project's data related.
Defined in:
op.tcl, line 1389

::op::recalc_brief

proc ::op::recalc_brief { uid db_handler ckTech brfList briefNum totHoursDec }
procedure recalc_brief refresh total minutes counted for breifing and training; and total money too
Parameters:
uid - op's ID
ckTeck - technical training flag
brfList - briefing flag list
briefNum - number of briefing records
totHoursDec - worked hours in decimal format
Returns:
Returns a list composed by these elements: 0: total minutes of briefing 1: total op's due before taxes 2: total op's due after taxes 3: total hours paid (brief included) in decial format
Defined in:
op.tcl, line 1084

::op::recalc_proj

proc ::op::recalc_proj { op_sum trnArray projMoney briefTime db_handler }
## recalc_proj
Parameters:
recalc - briefing time based on ops that have attend it
op_sum - the list returned by ::op::proj_calc
trnArray - the turnsArray array, in list format
projMoney - proj's cost, briefing excluded
briefTime - in decima
Returns:
Returns a list with these elements: 0: turnsArray with col 2 modified (including or exluding brief time) 1: briefing cost 2: total project's cost
Defined in:
op.tcl, line 1141

::op::recruit

proc ::op::recruit { db id type morning afternoon evening smsTxt brief action }
wrapper around op::recruit real just to guarantee transaction safetness
Defined in:
op.tcl, line 314

::op::recruitReal

proc ::op::recruitReal { db id type morning afternoon evening smsTxt brief action }
Get all operators suitable for the criteria supplied. It creates a table on dbs's recruitment schema where all operators that feet your need will be putted.
Parameters:
db - - db connection handler
id - project's id
type - operator's type needed
morning - is availability for morning requird?
afternoon - is availability for afternoon required?
evening - is availability for evening required?
smsTxt - sms's text
brief - briefing duration (it's a float number)
action - what do you want to do? (""|create|update)
Returns:
returns 0 on success; -1 on error.
Defined in:
op.tcl, line 345

::op::resetPwd

proc ::op::resetPwd { login pwd rhost userto }
Defined in:
op.tcl, line 748

::op::RetriveProjs

proc ::op::RetriveProjs { db_handler uid all }
Get projects where uid had worked for
Parameters:
db_handler - a db connection
uid - Op's ID
Returns:
Return the list of projects
Defined in:
op.tcl, line 1048

::op::saveOpData

proc ::op::saveOpData { db name surname address city cap phone1 phone2 cell email { bplace} bdate active notes points alt_addr alt_city alt_cap sex type code salary { bank} bank_addr bank_city bank_abi bank_cab bank_cc bank_owner morning afternoon { evening} availablefrom { login} context {mode 0} }
Save operator data on db
Parameters:
db - (op) database conncetion handler
name - operator's name
surname - operator's surname
address - operator's address
city - operator's city
cap - operator's postal code (zip)
phone1 - operator's phone1
phone2 - operator's phone2
cell - operator's mobile phone
email - operator's email
bplace - operator's birth-place
bdate - operator's bithday
active - active flag
notes - some notes
points - operator's points
alt_addr - alternative address
alt_city - alternative city
alt_cap - alternative postal code (zip)
sex - sex
type - operator's type
code - operator's code (codice fiscale)
salary - hour salary
bank - bank's name
bank_addr -
bank_city -
bank_abi -
bank_cab -
bank_cc -
bank_owner -
morning -
afternoon -
evening -
availablefrom -
login - operator's login
context - operator's voip context
mode - [optional] are you going to insert (1) or update (0) the contact? default mode is update
Returns:
0 on success; -1 on error and sets ::op::err properly
Defined in:
op.tcl, line 626

::op::setPicture

proc ::op::setPicture { db uid picpath }
set a user's picture to let a supervisor really knows who he/she is.
Parameters:
db - database connection handler
uid - user's uid
picpath - picture's file path
Returns:
Returns 0 on success, -1 on error.
Defined in:
op.tcl, line 1651

::op::sshRemoteBatch

proc ::op::sshRemoteBatch { host login passwd cmd }
::op::sshRemoteBatch - execute a cmd on a remote host
Parameters:
host - - remote hosts ip address/name
login - - admin account login on the remote server
passwd - - admin account password on the remote server
cmd - - the command to execute on the remote host
Defined in:
op.tcl, line 900

::op::sshRemoteResPwd

proc ::op::sshRemoteResPwd { host login passwd cmd pwdto }
Defined in:
op.tcl, line 862

::op::storePayments

proc ::op::storePayments { db proj op_sum trnArray }
## store op's billing data in paymentslog table
Parameters:
db - database connection handler
proj - project's ID
op_sum - operators hours work data
trnArray - the array displayed in hours report in listed forms
Returns:
Returns -1 on error, 1 on success
Defined in:
op.tcl, line 1593

::op::syncUser

proc ::op::syncUser { db login passwd host }
::op::syncUser - create / remove users on a remote server
Parameters:
db - - database connection hanlder
login - - admin account login on the remote server
passwd - - admin account password on the remote server
host - - the remote server
Returns:
0 on success, -1 on error due to ssh connection, -5 on db conn problems
Defined in:
op.tcl, line 773

::op::uid_calc

proc ::op::uid_calc { db_handler uid lProj }
Parameters:
db_handler - a db connection;
uid - op's ID;
lProj - the list of projects to examine;
Returns:
Returns a list composed by - start and end timestamp of each worksession; - worked time per session; - Total project's hours and cost
Defined in:
op.tcl, line 1521

::op::updateIntType

proc ::op::updateIntType { db id type }
Defined in:
op.tcl, line 558

::op::updateOpNote

proc ::op::updateOpNote { db op note {score {}} }
update note field for a user.
Parameters:
db - database connection handler
op - user's id
note - new op's note
Returns:
0 on success; -1 on error and sets ::op::err properly
Defined in:
op.tcl, line 572

::op::userPjs

proc ::op::userPjs { db user }
Get all user's projects
Parameters:
db - database connection handler
user - user's id
Returns:
list of user's projects name; -1 on error.
Defined in:
op.tcl, line 464

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