webBooks-Employees-APIs

From Cliquesoft
Revision as of 08:43, 27 March 2015 by Digitalpipe (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Employees

In order to process any of these API's, all requests should be directed to the 'modules/webbooks/employees.php' file. The type of request will be specified per section below.


Load the interface

To load the modules default HTML interface (themes/default/webbooks.employees.html), the below parameters should be passed to the appropriate php file via a GET request. Loading an alternative screen relies on the symlinks set in the users data directory (e.g. data/_guest/_theme/{images|layout|styles}).

action=init
target=screen
username=(the username for the account)
SID=(the security identifier for the account)

This will return the raw contents as it is found in the file, replacing all occurrences of the variable ${UN} anywhere.


Populate the form

To populate all the various values of the interface form objects, the below parameters will need to be passed via a GET request:

action=init
target=values
username=(the username for the account)
SID=(the security identifier for the account)
decrypt=(the decryption string for the account)

This will return all the information in the following XML layout:

   <general>
      <employee id="INTEGER" name="STRING" OPoID="STRING" homePhone="INTEGER" homeMobile="INTEGER" homeMobileSMS="{0|1}" homeMobileEmail="{0|1}" homeEmail="STRING" workPhone="INTEGER" workExt="INTEGER" workMobile="INTEGER" workMobileSMS="{0|1}" workMobileEmail="{0|1}" workEmail="STRING" location="INTEGER" department="INTEGER" supervisor="INTEGER" position="INTEGER" payTerms="{part-time|full-time|contractor|call|internship|volunteer}" payType="{hourly|salary|salary+ot|commission|commission+base|job}" basePay="DECIMAL" OTRate="DECIMAL" PTORate="DECIMAL" SickRate="DECIMAL" payCOLA="DECIMAL" payMileage="DECIMAL" payPerDiem="DECIMAL" hired="DATE" driversLicense="STRING" gender="{male|female}" ssn="INTEGER" dob="DATE" race="{african|asian|caucasian|hispanic|indian|me|na|mr|pi|other}" married="{single|married}" withholdings="DECIMAL" additional="INTEGER" dependents="INTEGER" manager="{0|1}" status="{verifying|active|locked|suspended}" attempts="INTEGER" username="STRING" created="EPOCH" updated="EPOCH" login="EPOCH" logout="EPOCH" />
      <address type="home" addr1="STRING" addr2="STRING" city="STRING" state="STRING" zip="STRING" country="STRING" />
      <address type="work" addr1="STRING" addr2="STRING" city="STRING" state="STRING" zip="STRING" country="STRING" />
      <payments PPPAP="DECIMAL" YTDAP="DECIMAL" PPPAC="DECIMAL" YTDAC="DECIMAL" PPPPR="DECIMAL" YTDPR="DECIMAL" />
      <leave PPPAP="DECIMAL" YTDAP="DECIMAL" PPPUP="DECIMAL" YTDUP="DECIMAL" PPPAS="DECIMAL" YTDAS="DECIMAL" PPPUS="DECIMAL" YTDUS="DECIMAL" />
      <donated PPPDP="DECIMAL" YTDDP="DECIMAL" PPPDS="DECIMAL" YTDDS="DECIMAL" />
   </general>
   <locations>
      <location id="INTEGER" name="STRING" />

      ...repeated for each additional location of the organization...
   </locations>
   <departments>
      <dept id="INTEGER" name="STRING" />

      ...repeated for each department created for the organization...
   </departments>
   <supervisors>
      <supervisor id="INTEGER" name="STRING" />

      ...repeated for each employee of the organization that can become someone else's supervisor...
   </supervisors>
   <positions>
      <pos id="INTEGER" name="STRING" />

      ...repeated for each position created for the organization...
   </positions>
   <people>
      <person id="INTEGER" name="STRING" />

      ...repeated for each employee that can have time donated to...
   </people>
   <modules>
      <module id="INTEGER" name="STRING" />

      ...repeated for each module that is currently installed...
   </modules>
   <looks>
      <look skin="STRING" theme="STRING" icons="STRING" />
      <skin>STRING</skin>

      ...repeated for each installed skin...
      <theme>STRING</theme>

      ...repeated for each installed theme...
      <image>STRING</image>

      ...repeated for each install image set...
   </looks>
   <time>
      <record id="INTEGER" type="{in|out|pto|sick|unpaid}" occurred="EPOCH" createdID="INTEGER" createdBy="STRING" />

      ...repeated for each time record for the employee...
   </time>
   <notes>
      <note id="INTEGER" type="{employee|customer|wo}" creator="STRING" created="EPOCH" updated="EPOCH">STRING</note>

      ...repeated for each note associated with the employee...
   </notes>
   <data>
      <entry id="INTEGER" title="STRING" filename="STRING" />
      ...repeated for each custom data field on the 'Data' tab...

      <file filename="STRING" />
      ...repeated for each file uploaded through the 'Data' tab...
   </data>


Load a different employee

To load any employee of the organization, the below parameters will need to be passed via a GET request:

action=load
target=employee
username=(the username for the account)
SID=(the security identifier for the account)
decrypt=(the decryption string for the account)
id=(the ID of the employee to load)

See the "Populate the form" section above for the returned XML.


Save the loaded employee information

To save all the various values of the interface form objects, the below parameters will need to be passed via a POST request:

action=save
target=employee
username=(the username for the account)
SID=(the security identifier for the account)
decrypt=(the decryption string for the account)
sEmployeeName_Employees=(the name of the employee)
sOPoID_Employees=[for future use]
sGender_Employees={male|female}
nSSN_Employees=(the social security number of the employee)
eDOB_Employees=(the date of birth of the employee)
sRace_Employees={african|asian|caucasian|hispanic|indian|me|na|mr|pi|other}
sMarried_Employees={single|married}
sDriversLicense_Employees=(the drivers license number of the employee)
nWithheld_Employees=(any additional withholdings to keep out of every employee paycheck)
nAllowance_Employees=(any declared personal allowances of the employee)
nDependents_Employees=(the number of dependants of the employee)
nHomePhone_Employees=(the home phone number of the employee)
nHomeMobile_Employees=(the personal mobile phone number of the employee)
bHomeMobileSMS_Employees={0|1}
bHomeMobileEmail_Employees={0|1}
sHomeEmail_Employees=(the personal email address of the employee)
sHomeAddr1_Employees=(the line 1 of the employee's home address)
sHomeAddr2_Employees=(the line 2 of the employee's home address)
sHomeCity_Employees=(the city of the employee's home address)
sHomeState_Employees=(the state of the employee's home address)
sHomeZip_Employees=(the zip code of the employee's home address)
sHomeCountry_Employees=(the country of the employee's home address)
nWorkPhone_Employees=(the work phone number of the employee)
nWorkExt_Employees=(the work phone extension of the employee)
nWorkMobile_Employees=(the work mobile phone number of the employee)
bWorkMobileSMS_Employees={0|1}
bWorkMobileEmail_Employees={0|1}
sWorkEmail_Employees=(the work email address of the employee)
sWorkAddr1_Employees=(the line 1 of the employee's work address)
sWorkAddr2_Employees=(the line 2 of the employee's work address)
sWorkCity_Employees=(the city of the employee's work address)
sWorkState_Employees=(the state of the employee's work address)
sWorkZip_Employees=(the zip code of the employee's work address)
sWorkCountry_Employees=(the country of the employee's work address)
nWorkLocation_Employees=(which location the employee works at)
sDept_Employees=(the department that the employee works in)
sSupervisor_Employees=(the supervisor of the employee)
sJobTitle_Employees=(the position that the employee holds)
sPayTerms_Employees={part-time|full-time|contractor|call|internship|volunteer}
sPayType_Employees={hourly|salary|salary+ot|commission|commission+base|job}
nStandardPay_Employees=(the job pay for the position)
nOTPay_Employees=(the rate at which overtime should be calculated)
nSickLeave_Employees=(the rate of sick leave received over each pay period)
nPersonalLeave_Employees=(the rate of personal time off received over each pay period)
nCOLA_Employees=(the annual cost of living increase rate)
nMileage_Employees=(the mileage reimbursement rate)
nPerDiem_Employees=(the per diem allotted per day of travel)
eHired_Employees=(the hire date of the employee)
sManager_Employees={0|1}
sUsername_Employees=(the username of the employee to log into this software)
sPassword_Employees=(the password of the employee's account)
sConfirm_Employees=(the confirmation password to ensure the proper one was entered)
sAccountStatus_Employees={verifying|active|locked|suspended}

This will return all the information in the following XML layout:

   <s><msg>The employee information has been updated successfully!</msg><data id="INTEGER" [username="STRING" decrypt="STRING"]></data></s>

   OR

   <f><msg>...</msg></f>

NOTE: the 'username' and 'decrypt' data values will be returned if the employee is adjusting their account!


Load the positions

To load all the positions associated with the selected department, the below parameters will need to be passed via a GET request:

action=load
target=positions
username=(the username for the account)
SID=(the security identifier for the account)
deptID=(the ID of the department)

This will return all the information in the following XML layout:

   <positions>
      <pos id="INTEGER" name="STRING" />

      ...repeated for position associated with the selected department...
   </positions>


Load the selected position information

To load all the information with the selected position, the below parameters will need to be passed via a GET request:

action=load
target=position
username=(the username for the account)
SID=(the security identifier for the account)
posID=(the ID of the position)

This will return all the information in the following XML layout:

   <positions>
      <pos id="INTEGER" name="STRING" dept="INTEGER" payType="{hourly|salary|salary+ot|commission|commission+base|job}" payTerms="{part-time|full-time|contractor|call|internship|volunteer}" basePay="DECIMAL" OTRate="DECIMAL" PTORate="DECIMAL" SickRate="DECIMAL" payCOLA="DECIMAL" payMileage="DECIMAL" payPerDiem="DECIMAL" />
   </positions>


To donate leave to another employee, the below parameters will need to be passed via a GET request:

action=donate
target=time
username=(the username for the account)
SID=(the security identifier for the account)
sourceID=(the ID of the employee that is donating the time)
targetID=(the ID of the employee that will receive the donated time)
type={pto|sick}
hours=(the number of hours you want to donate)

This will return all the information in the following XML layout:

   <s><msg>The time has been donated successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Load employee access

To load the access rights of the selected module for the loaded employee, the below parameters will need to be passed via a GET request:

action=load
target=access
username=(the username for the account)
SID=(the security identifier for the account)
moduleID=(the ID of the module)
accountID=(the ID of the loaded employees account)

This will return all the information in the following XML layout:

   <positions>
      <pos id="INTEGER" name="STRING" dept="INTEGER" payType="{hourly|salary|salary+ot|commission|commission+base|job}" payTerms="{part-time|full-time|contractor|call|internship|volunteer}" basePay="DECIMAL" OTRate="DECIMAL" PTORate="DECIMAL" SickRate="DECIMAL" payCOLA="DECIMAL" payMileage="DECIMAL" payPerDiem="DECIMAL" />
   </positions>


Update employee access

To update the access rights of the selected module for the loaded employee, the below parameters will need to be passed via a POST request:

action=update
target=access
username=(the username for the account)
SID=(the security identifier for the account)
accountID=(the ID of the loaded employees account)
chkRead_Employees={0|1}
chkWrite_Employees={0|1}
chkAddRecords_Employees={0|1}
chkDelRecords_Employees={0|1}

This will return all the information in the following XML layout:

   <s><msg>The module access has been updated successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Update the account looks

To update the various type of looks for the loaded employee account, the below parameters will need to be passed via a GET request:

action=update
target={skin|theme|icons}
username=(the username for the account)
SID=(the security identifier for the account)
sSkinsList_Employees=(the name of the skin to use)
sThemesList_Employees=(the name of the theme to use)
sIconsList_Employees=(the name of the icon set to use)

NOTE: the required 's*List_Employees' parameter depends on which 'target' value is used.

This will return all the information in the following XML layout:

   <s><msg>The {skin|theme|icons} has been updated successfully!</msg></s>

   OR

   <f><msg>...</msg></f>


Load a time record

To load a time record of the loaded employee account, the below parameters will need to be passed via a GET request:

action=load
target=time
username=(the username for the account)
SID=(the security identifier for the account)
id=(the ID of the time record to load)

This will return all the information in the following XML layout:

   <time>
      <record id="INTEGER" type="{in|out|pto|sick|unpaid}" occurred="EPOCH" createdID="INTEGER" createdBy="STRING" updatedID="INTEGER" [time="DECIMAL"]>STRING</record>
   </time>

NOTE: if there is a corresponding 'out' record in the event you're looking at an 'in', 'pto', or 'sick' record, the the 'time' value will be returned as well.


Delete a time record

To delete a time record of the loaded employee account, the below parameters will need to be passed via a GET request:

action=delete
target=work
username=(the username for the account)
SID=(the security identifier for the account)
id=(the ID of the time record to delete)
direction=(if the user if filtering the time records, this value corresponds to the direction of the filter - before|after)
date=(if the user if filtering the time records, this value corresponds to the date of the filter)

This will return all the information in the following XML layout:

   <time>
      <record id="INTEGER" type="{in|out|pto|sick|unpaid}" occurred="EPOCH" createdID=".INTEGER" createdBy="STRING" />
   </time>


Update a time record

To update a time record of the loaded employee account, the below parameters will need to be passed via a POST request:

action=update
target=work
username=(the username for the account)
SID=(the security identifier for the account)
id=(the ID of the time record to delete)
direction=(if the user if filtering the time records, this value corresponds to the direction of the filter - before|after)
date=(if the user if filtering the time records, this value corresponds to the date of the filter)
employee=(the ID of the loaded employee)
eLeaveDate_Employees=(the date in which the time record took place)
nLeaveHour_Employees=(the hour in which the time record took place)
nLeaveMin_Employees=(the minute in which the time record took place)
sLeaveHalf_Employees={am|pm}
eLeaveHours_Employees=(the number of hours that span the time record)
sLeaveMemo_Employees=[any memo that should be associated with the time record]
sLeaveType_Employees={in|out|pto|sick|unpaid}

This will return all the information in the following XML layout:

   <time>
      <record id="INTEGER" type="{in|out|pto|sick|unpaid}" occurred="EPOCH" createdID=".INTEGER" createdBy="STRING" />
   </time>


Filter the time records list

To filter the records shown in the time records list of the loaded employee account, the below parameters will need to be passed via a POST request:

action=filter
target=work
username=(the username for the account)
SID=(the security identifier for the account)
direction=(this value corresponds to the direction of the filter - before|after)
date=(this value corresponds to the date of the filter)

This will return all the information in the following XML layout:

   <time>
      <record id="INTEGER" type="{in|out|pto|sick|unpaid}" occurred="EPOCH" createdID=".INTEGER" createdBy="STRING" />
   </time>