This repository contains the code for the project BambooHR-connector
, which automatically imports the absences for all employees from BambooHR to Papershift.
Product Owner / Project Manager: Christoph Batik
Developer: Georgi Damyanov
- MAMP or XAMPP
- PHP 7.1
Git clone
this repository intoMAMP/XAMPP
- Run
composer install
To use the connector first you have to configure it.
-
Open Config.php
-
Fill the missing
keys
. -
bamboohr
api_token
- The API key for BambooHRcompany
- company namefilter_enabled
-enables/disables
the absences filter (lookfilter_array
)filter_array
- which absences to befiltered/removed
date
- Only the absences from this date will be taken. You can choose betweenyesterday
,today
,tomorrow
or givecustom Y-m-d
.status
- Which absences to get. You can choose fromapproved
,denied
,superceded
,requested
,canceled
-
papershift
api_token
- The API key for Papershiftapi_absences_url
- The Papershift API absences URLapi_absences_confirm_url
- The Papershift API absences/confirm URL
Papershift requires
start
andend time
for the absencesstart_time_days
- Start time for the absenceend_time_days
- End time for the absencefull_day
- Full day
Papershift does not allow to enter the absence hours. That is why every time there are hours (2,3,4 hours) they are counted from
00:00:00
onward. ( the hours are calculated insidePapershiftAbsences.php
)start_time_hours
- The start time for the hours
-
mail
smtp_host
- Your e-mail hostsmtp_auth
- If Authentication should be enabledusername
- Your e-mailpassword
- Your e-mail passwordsmtp_secure
- Securityport
- Portsend_from
- Sender (e-mail)send_to
- Recipient (e-mail)
Once you are done with the configuration, to run the script:
- Open
Connector.php
inside your browser - It will take couple of minutes, which highly depends on how many absences there are
- You will be notified per e-mail if the import was successful or failed
There are no tests at this point, you have to test manually.
There are two logs inside the log
folder.
tmp_error_log.txt
which is used to temporarily store the errors.global_error_log.txt
contains all the errors.
Errors from tmp_error_log.txt
are send via e-mail. Then it appends the errors to the global_error_log.txt
and clears itself. Next time the script runs tmp_error_log
will be empty. That way you don't get all errors per e-mail, but only the errors from the current day.