Auto-Pilot feature on scheduler

Topics brought up by the TimeTrex open source community.
Locked
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Auto-Pilot feature on scheduler

Post by rons »

I have the auto-pilot feature set on the recuuring schedule template that I created for salaried employees but the system is not automatically punching them in/out based on the schedule. The maintenance cron feature appears to be running correctly.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

The auto-pilot will only punch employees in/out approx. 4 hours before their shift is scheduled to start. This allows for the most amount of time to reschedule employees before they are automatically punched in.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

I have had the recurring schedule set with auto-pilot for the past 5 days for several employees and none of them have a punch in or out in their time sheet.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

If you bring up the schedule (Schedule -> MySchedule) for the employees and date ranges that the auto-pilot recurring schedule applies to, are the schedule entries in black text, or blue text with a link?
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

Black text with a link. The background turns blue when the day link is selected.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Sorry, I should have been more specific. Is the text that displays the employees time, ie:

8:00 AM - 5:00 PM

black text and no hyperlink, or blue text and a hyperlink? If you can provide a screenshot that would be ideal.

If its black text, that means your maintenance jobs are not inserting schedules into the database for some reason. You will probably need to check your logs to find out why.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

I am having trouble showing the screenshot in this post, but it is blue background and text with a hperlink that connects to that day's edit Schedule screen. It looks like the maintenance cron.php is running correctly. It does however complain about not being able to contact the LDAP server as null. This server was used to test an ldap setup but it was later removed.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Can you email the screenshot to support@timetrex.com?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Okay, the screenshot shows black text that is not a hyperlink, so your maintenance scripts are not running properly.

If you go to Help -> About in the menu, what does it say for: "Maintenance Jobs Last Ran"?
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

July 13, 2007 6:21 pm
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Okay, can you enable debugging (explained here: http://forums.timetrex.com/viewtopic.php?t=89) in your timetrex.ini.php file, with verbosity set to 10, then run:

Code: Select all

maint/php AddRecurringScheduleShift.php
Post the output here.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

First I had to change the code to: php maint/AddRecurringScheduleShift.php after enabling debbugging for it to run. With verbosity set to 10 there was no output. I changed it to 11 and got this:
-----
-----
(postgres7):
select *
from recurring_schedule_template
where recurring_schedule_template_cont rol_id = ?
AND deleted = 0
ORDER BY week asc
-----
-----
(postgres7):
select d.*
from policy_group_user as a,
policy_group as b,
holiday_policy as c,
holidays as d
where a.policy_group_id = b.id
AND b.holiday_policy_id = c.id
AND c.id = d.holiday_policy_id
AND a.user_id = ?
AND d.date_stamp = ?
AND ( c.deleted = 0 AND d.delete d=0 )

-----
-----
(postgres7):
select a.*
from pay_period_schedule as a,
pay_period_schedule_user as b
where a.id = b.pay_period_schedule_id
AND b.user_id = ?
AND a.deleted=0
-----
-----
(postgres7):
select a.*
from punch as a,
punch_control as b,
user_date as c
where a.punch_control_id = b.id
AND b.user_date_id = c.id
AND c.user_id = ?
AND c.date_stamp = ?
AND ( a.deleted = 0 AND b.delete d=0 AND c.deleted=0)
ORDER BY a.time_stamp asc, a.status_id a sc
LIMIT 1

-----
-----
(postgres7):
select *
from user_date
where
user_id = ?
AND date_stamp = ?
AND deleted = 0
ORDER BY id ASC

-----
-----
(postgres7):
select *
from user_date
where id = ?
AND deleted = 0
-----
-----
(postgres7):
select a.*
from schedule as a,
user_date as b
where a.user_date_id = b.id
AND a.user_date_id = ?
AND
(
(start_time > ? AND end_ time < ? )
OR
(start_time > ? AND star t_time < ? )
OR
(end_time > ? AND end_ti me < ? )
OR
(start_time < ? AND end_ time > ? )
OR
(start_time = ? AND end_ time = ? )
)
AND ( a.deleted = 0 AND b.delete d=0 )
ORDER BY start_time
-----
-----
(postgres7):
select a.*
from schedule as a,
user_date as b
where a.user_date_id = b.id
AND a.user_date_id = ?
AND
(
(start_time > ? AND end_ time < ? )
OR
(start_time > ? AND star t_time < ? )
OR
(end_time > ? AND end_ti me < ? )
OR
(start_time < ? AND end_ time > ? )
OR
(start_time = ? AND end_ time = ? )
)
AND ( a.deleted = 0 AND b.delete d=0 )
ORDER BY start_time
-----
-----
(postgres7): SELECT NEXTVAL('schedule_id_seq')
-----
/tmp/timetrex//d1/adodb_d105d8036816d7554fcaf001f419b328.cache reloaded, ttl=47 598 [ select user_date_id,status_id,start_time,end_time,schedule_policy_id,branc h_id,department_id,job_id,job_item_id,total_time,absence_policy_id,created_date, updated_date,id from schedule where id = -1 ]
-----
(postgres7): INSERT INTO schedule ( USER_DATE_ID, STATUS_ID, START_TIME, END_TIM E, SCHEDULE_POLICY_ID, BRANCH_ID, DEPARTMENT_ID, JOB_ID, JOB_ITEM_ID, TOTAL_TIME , ABSENCE_POLICY_ID, CREATED_DATE, UPDATED_DATE, ID ) VALUES ( 143, 10, '2007-07 -13 08:30:00 EDT', '2007-07-13 17:30:00 EDT', 1, 0, 0, 0, null, 28800, null, 118 4384204, 1184384204, 219 )
-----
-----
(postgres7): SELECT NEXTVAL('system_log_id_seq')
-----
/tmp/timetrex//24/adodb_24aeda327071258c083d33d90de7ac2f.cache reloaded, ttl=61 998 [ select object_id,action_id,table_name,user_id,description,date,id from sys tem_log where id = -1 ]
-----
(postgres7): INSERT INTO system_log ( OBJECT_ID, ACTION_ID, TABLE_NAME, USER_ID, DESCRIPTION, DATE, ID ) VALUES ( 219, 10, 'schedule', 0, 'Schedule', 1184384204 , 1522 )
-----
-----
(postgres7):
select a.*
from pay_period_schedule as a,
pay_period_schedule_user as b
where a.id = b.pay_period_schedule_id
AND b.user_id = ?
AND a.deleted=0
-----
-----
(postgres7):
select a.*
from punch as a,
punch_control as b,
user_date as c
where a.punch_control_id = b.id
AND b.user_date_id = c.id
AND c.user_id = ?
AND c.date_stamp = ?
AND ( a.deleted = 0 AND b.delete d=0 AND c.deleted=0)
ORDER BY a.time_stamp asc, a.status_id a sc
LIMIT 1

-----
-----
(postgres7):
select *
from user_date
where
user_id = ?
AND date_stamp = ?
AND deleted = 0
ORDER BY id ASC

-----
-----
(postgres7):
select *
from user_date
where id = ?
AND deleted = 0
-----
-----
(postgres7):
select *
from user_date
where id = ?
AND deleted = 0
-----
-----
(postgres7): SELECT NEXTVAL('punch_control_id_seq')
-----
/tmp/timetrex//d1/adodb_d144bfe037fa76e3db2a103b60e57dee.cache reloaded, ttl=51 198 [ select user_date_id,branch_id,department_id,job_id,job_item_id,quantity,ba d_quantity,created_date,updated_date,id from punch_control where id = -1 ]
-----
(postgres7): INSERT INTO punch_control ( USER_DATE_ID, BRANCH_ID, DEPARTMENT_ID, JOB_ID, JOB_ITEM_ID, QUANTITY, BAD_QUANTITY, CREATED_DATE, UPDATED_DATE, ID ) V ALUES ( 143, 0, 0, 0, 0, 0, 0, 1184384204, 1184384204, 270 )
-----
-----
(postgres7):
select *
from punch_control
where id = ?
AND deleted = 0
-----
-----
(postgres7):
select *
from punch_control
where id = ?
AND deleted = 0
-----
-----
(postgres7):
select *
from user_date
where id = ?
AND deleted = 0
-----
/tmp/timetrex//1b/adodb_1bec56dbb0572ef089a9eaacf68eaa71.cache reloaded, ttl=65 598 [ select * from round_interval_policy where id = -1 ]
-----
(postgres7):
select c.*
from policy_group_user as a,
policy_group_round_inter val_policy as b,
round_interval_policy as c,
round_interval_policy as d
where a.policy_group_id = b.policy_gro up_id
AND b.round_interval_policy_id = c.id
AND b.round_interval_policy_id = d.id
AND a.user_id = ?
AND c.punch_type_id in ( ?,?,?)
AND ( c.deleted = 0 AND d.delete d=0 )
order by c.punch_type_id desc L IMIT 1
-----
/tmp/timetrex//0d/adodb_0d344de28c3c9b8951ec6863665b789b.cache reloaded, ttl=65 598 [ select * from punch where id = -1 ]
-----
(postgres7):
select *
from punch as a
where punch_control_id = ?
AND deleted = 0 order by time_st amp desc
-----
-----
(postgres7):
select a.*
from punch as a,
punch_control as b
where a.punch_control_id = b.id
AND b.user_date_id = ?
AND ( a.deleted = 0 AND b.delete d=0 )
ORDER BY a.time_stamp asc, a.status_id d esc, a.punch_control_id asc

-----
/tmp/timetrex//0d/adodb_0d344de28c3c9b8951ec6863665b789b.cache reloaded, ttl=65 598 [ select * from punch where id = -1 ]
-----
(postgres7):
select *
from punch as a
where punch_control_id = ?
AND deleted = 0 order by time_st amp desc
-----
-----
(postgres7):
select a.*
from punch as a,
punch_control as b
where a.punch_control_id = b.id
AND b.user_date_id = ?
AND ( a.deleted = 0 AND b.delete d=0 )
ORDER BY a.time_stamp asc, a.status_id d esc, a.punch_control_id asc

-----
-----
(postgres7): SELECT NEXTVAL('punch_id_seq')
-----
/tmp/timetrex//22/adodb_220b936fb6baea85a557d438468e96b4.cache reloaded, ttl=47 598 [ select punch_control_id,type_id,status_id,time_stamp,actual_time_stamp,ori ginal_time_stamp,created_date,updated_date,id from punch where id = -1 ]
-----
(postgres7): INSERT INTO punch ( PUNCH_CONTROL_ID, TYPE_ID, STATUS_ID, TIME_STAM P, ACTUAL_TIME_STAMP, ORIGINAL_TIME_STAMP, CREATED_DATE, UPDATED_DATE, ID ) VALU ES ( 270, 10, 10, '2007-07-13 08:30:00 EDT', '2007-07-13 08:30:00 EDT', '2007-07 -13 08:30:00 EDT', 1184384204, 1184384204, 527 )
-----
-----
(postgres7): SELECT NEXTVAL('system_log_id_seq')
-----
/tmp/timetrex//24/adodb_24aeda327071258c083d33d90de7ac2f.cache reloaded, ttl=61 998 [ select object_id,action_id,table_name,user_id,description,date,id from sys tem_log where id = -1 ]
-----
(postgres7): INSERT INTO system_log ( OBJECT_ID, ACTION_ID, TABLE_NAME, USER_ID, DESCRIPTION, DATE, ID ) VALUES ( 527, 10, 'punch', 0, 'Punch - Timestamp: 13-Ju l-07 8:30 AM EDT', 1184384204, 1523 )
-----
-----
(postgres7): select id,user_date_id,branch_id,department_id,job_id,job_item_id,q uantity,bad_quantity,total_time,actual_total_time,meal_policy_id,overlap,created _date,created_by,updated_date,updated_by,deleted_date,deleted_by,deleted,other_i d1,other_id2,other_id3,other_id4,other_id5,note from punch_control where id = 27 0
-----
-----
(postgres7):
select *
from punch_control
where id = ?
AND deleted = 0
-----
-----
(postgres7):
select *
from punch_control
where id = ?
AND deleted = 0
-----
-----
(postgres7):
select *
from user_date
where id = ?
AND deleted = 0
-----
/tmp/timetrex//1b/adodb_1bec56dbb0572ef089a9eaacf68eaa71.cache reloaded, ttl=65 598 [ select * from round_interval_policy where id = -1 ]
-----
(postgres7):
select c.*
from policy_group_user as a,
policy_group_round_inter val_policy as b,
round_interval_policy as c,
round_interval_policy as d
where a.policy_group_id = b.policy_gro up_id
AND b.round_interval_policy_id = c.id
AND b.round_interval_policy_id = d.id
AND a.user_id = ?
AND c.punch_type_id in ( ?,?,?,? )
AND ( c.deleted = 0 AND d.delete d=0 )
order by c.punch_type_id desc L IMIT 1
-----
/tmp/timetrex//0d/adodb_0d344de28c3c9b8951ec6863665b789b.cache reloaded, ttl=65 598 [ select * from punch where id = -1 ]
-----
(postgres7):
select *
from punch as a
where punch_control_id = ?
AND deleted = 0 order by time_st amp desc
-----
-----
(postgres7):
select a.*
from punch as a,
punch_control as b
where a.punch_control_id = b.id
AND b.user_date_id = ?
AND ( a.deleted = 0 AND b.delete d=0 )
ORDER BY a.time_stamp asc, a.status_id d esc, a.punch_control_id asc

-----
/tmp/timetrex//0d/adodb_0d344de28c3c9b8951ec6863665b789b.cache reloaded, ttl=65 598 [ select * from punch where id = -1 ]
-----
(postgres7):
select *
from punch as a
where punch_control_id = ?
AND deleted = 0 order by time_st amp desc
-----
-----
(postgres7):
select a.*
from punch as a,
punch_control as b
where a.punch_control_id = b.id
AND b.user_date_id = ?
AND ( a.deleted = 0 AND b.delete d=0 )
ORDER BY a.time_stamp asc, a.status_id d esc, a.punch_control_id asc

-----
-----
(postgres7): SELECT NEXTVAL('punch_id_seq')
-----
/tmp/timetrex//22/adodb_220b936fb6baea85a557d438468e96b4.cache reloaded, ttl=47 598 [ select punch_control_id,type_id,status_id,time_stamp,actual_time_stamp,ori ginal_time_stamp,created_date,updated_date,id from punch where id = -1 ]
-----
(postgres7): INSERT INTO punch ( PUNCH_CONTROL_ID, TYPE_ID, STATUS_ID, TIME_STAM P, ACTUAL_TIME_STAMP, ORIGINAL_TIME_STAMP, CREATED_DATE, UPDATED_DATE, ID ) VALU ES ( 270, 10, 20, '2007-07-13 17:30:00 EDT', '2007-07-13 17:30:00 EDT', '2007-07 -13 17:30:00 EDT', 1184384204, 1184384204, 528 )
-----
-----
(postgres7): SELECT NEXTVAL('system_log_id_seq')
-----
/tmp/timetrex//24/adodb_24aeda327071258c083d33d90de7ac2f.cache reloaded, ttl=61 998 [ select object_id,action_id,table_name,user_id,description,date,id from sys tem_log where id = -1 ]
-----
(postgres7): INSERT INTO system_log ( OBJECT_ID, ACTION_ID, TABLE_NAME, USER_ID, DESCRIPTION, DATE, ID ) VALUES ( 528, 10, 'punch', 0, 'Punch - Timestamp: 13-Ju l-07 5:30 PM EDT', 1184384204, 1524 )
-----
/tmp/timetrex//0d/adodb_0d344de28c3c9b8951ec6863665b789b.cache reloaded, ttl=65 598 [ select * from punch where id = -1 ]
-----
(postgres7):
select *
from punch as a
where punch_control_id = ?
AND deleted = 0 order by time_st amp desc
-----
-----
(postgres7):
select *
from punch_control
where id = ?
AND deleted = 0
-----
/tmp/timetrex//d7/adodb_d72712aceb00abb218c7d368d403fb6a.cache reloaded, ttl=65 598 [ select * from schedule where id = -1 ]
-----
(postgres7):
select *
from schedule
where user_date_id = ?
AND deleted = 0 order by start_t ime asc
-----
-----
(postgres7):
select *
from schedule
where id = ?
AND deleted = 0
-----
-----
(postgres7): select id,user_date_id,branch_id,department_id,job_id,job_item_id,q uantity,bad_quantity,total_time,actual_total_time,meal_policy_id,overlap,created _date,created_by,updated_date,updated_by,deleted_date,deleted_by,deleted,other_i d1,other_id2,other_id3,other_id4,other_id5,note from punch_control where id = 27 0
-----
-----
(postgres7): UPDATE punch_control SET TOTAL_TIME=28800, ACTUAL_TOTAL_TIME=28800, MEAL_POLICY_ID=1 WHERE id = 270
-----
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

What you just showed me there is that some schedules were created, and even some punches were created. So based on that everything appears to be working fine.

Which employee is User ID: 143? Whomever it is just had a schedule added for: '2007-07 -13 08:30:00 EDT'

You can find out who User ID 143 is by pointing your browser to: interface/users/EditUser.php?id=143

Once you figure out who it is, check their schedule and timesheet to confirm the data is indeed there.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

User ID 143 is blank. I only have 4 test users in the system with user ID 1 to 4.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Sorry, that was user_date_id = 143, which you would have to run a SQL query to find out which user that is.

If you only have four users in the system, cycle through each of them and find out which was punched in at:

'2007-07 -13 08:30:00 EDT'
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

None of the 4 employees have a punch in at 8:30 am on 7/13/2007.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Please post the [debug] section of your timetrex.ini.php file.

I'm not seeing all the debug information that should be included. What you showed me is just the SQL queries, there should be a whole bunch more debug text below that that looks like this:

Code: Select all

Debug Buffer
============================================================================
Memory Usage: 16746344
----------------------------------------------------------------------------
DEBUG [188]: [Function](): URI: /bullet_time/interface/station/EditStation.php?sort_column=&sort_order=&page=1
DEBUG [190]: [Function](): Production: 0
DEBUG [80]: TTDate::setTimeZone(): Setting TimeZone: GMT
DEBUG [471]: Authentication::Check(): Session Name: SessionID
DEBUG [477]: Authentication::Check(): Session ID: 58ded48c7fcd3bf48d19cd9bb9733b0b
DEBUG [282]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:58ded48c7fcd3bf48d19cd9bb9733b0b
DEBUG [58]: Authentication::getIdle(): Idle Seconds Allowed: 14400
DEBUG [282]: Validator::stripNonAlphaNumeric(): Alpha Numeric String:58ded48c7fcd3bf48d19cd9bb9733b0b
DEBUG [47]: [Function](): User Authenticated: mike.benoit Created Date: 1184531342
DEBUG [1695]: UserFactory::isInformationComplete(): User Information is Complete:
DEBUG [80]: TTDate::setTimeZone(): Setting TimeZone: PST8PDT
DEBUG [109]: TTDate::setDateFormat(): Setting Default Date Format: d/m/Y
DEBUG [123]: TTDate::setTimeFormat(): Setting Default Time Format: g:i A
DEBUG [137]: TTDate::setTimeUnitFormat(): Setting Default Time Unit Format: 10
...
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

Here it is:
<b>Debug Buffer</b><br>
============================================================================<br>
Memory Usage: 4419952<br>
----------------------------------------------------------------------------<br>
DEBUG [200]: <b>[Function]()</b>: URI: maint/AddRecurringScheduleShift.php<br>
DEBUG [202]: <b>[Function]()</b>: Production: 1<br>
DEBUG [53]: <b>[Function]()</b>: Recurring Schedule Control List Record Count: 1<br>
DEBUG [711]: <b>Factory::StartTransaction()</b>: StartTransaction(): Transaction Count: 0 Trans Off: 0<br>
DEBUG [58]: <b>[Function]()</b>: Recurring Schedule ID: 1<br>
DEBUG [298]: <b>RecurringScheduleControlFactory::getShiftsByStartDateAndEndDate()</b>: Start Date: 15-Jul-07 12:00 AM EDT End Date: 16-Jul-07 12:36 AM EDT<br>
DEBUG [306]: <b>RecurringScheduleControlFactory::getShiftsByStartDateAndEndDate()</b>: Week: 1<br>
DEBUG [244]: <b>RecurringScheduleTemplateFactory::getTotalTime()</b>: Meal Policy Deduct Amount: 3600 Total Time: 480<br>
DEBUG [246]: <b>RecurringScheduleControlFactory::ReMapWeeks()</b>: Start Week: 1<br>
DEBUG [270]: <b>RecurringScheduleControlFactory::ReMapWeeks()</b>: Weeks do not need reordering: <br>
DEBUG [321]: <b>RecurringScheduleControlFactory::getShiftsByStartDateAndEndDate()</b>: Week of Start Date: 28<br>
DEBUG [347]: <b>RecurringScheduleControlFactory::getShiftsByStartDateAndEndDate()</b>: Found Scheduled Time: Start Time: 16-Jul-07 8:30 AM EDT<br>
DEBUG [356]: <b>RecurringScheduleControlFactory::getShiftsByStartDateAndEndDate()</b>: Start Date: 16-Jul-07 8:30 AM EDT End Date: 16-Jul-07 5:30 PM EDT<br>
DEBUG [69]: <b>[Function]()</b>: Recurring Schedule Shift Date Stamp: 21-Aug-70 3:11 AM EDT<br>
DEBUG [75]: <b>[Function]()</b>: aaI: 0/4 User ID: 1<br>
DEBUG [82]: <b>[Function]()</b>: (Before User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [100]: <b>TTDate::setTimeZone()</b>: Setting TimeZone: America/New_York<br>DEBUG [96]: <b>[Function]()</b>: User Name: ronswift89<br>
DEBUG [104]: <b>[Function]()</b>: (After User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [276]: <b>[Function]()</b>: Recurring Schedule Shift Start Time DOES NOT fall within Limits: 16-Jul-07 8:30 AM EDT<br>
DEBUG [75]: <b>[Function]()</b>: aaI: 0/4 User ID: 2<br>
DEBUG [82]: <b>[Function]()</b>: (Before User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [100]: <b>TTDate::setTimeZone()</b>: Setting TimeZone: America/New_York<br>DEBUG [96]: <b>[Function]()</b>: User Name: michael<br>
DEBUG [104]: <b>[Function]()</b>: (After User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [276]: <b>[Function]()</b>: Recurring Schedule Shift Start Time DOES NOT fall within Limits: 16-Jul-07 8:30 AM EDT<br>
DEBUG [75]: <b>[Function]()</b>: aaI: 0/4 User ID: 3<br>
DEBUG [82]: <b>[Function]()</b>: (Before User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [100]: <b>TTDate::setTimeZone()</b>: Setting TimeZone: America/New_York<br>DEBUG [96]: <b>[Function]()</b>: User Name: dean<br>
DEBUG [104]: <b>[Function]()</b>: (After User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [276]: <b>[Function]()</b>: Recurring Schedule Shift Start Time DOES NOT fall within Limits: 16-Jul-07 8:30 AM EDT<br>
DEBUG [75]: <b>[Function]()</b>: aaI: 0/4 User ID: 4<br>
DEBUG [82]: <b>[Function]()</b>: (Before User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [100]: <b>TTDate::setTimeZone()</b>: Setting TimeZone: America/New_York<br>DEBUG [96]: <b>[Function]()</b>: User Name: tasha<br>
DEBUG [104]: <b>[Function]()</b>: (After User TimeZone)Recurring Schedule Shift Start Time: 16-Jul-07 8:30 AM EDT End Time: 16-Jul-07 5:30 PM EDT<br>
DEBUG [276]: <b>[Function]()</b>: Recurring Schedule Shift Start Time DOES NOT fall within Limits: 16-Jul-07 8:30 AM EDT<br>
DEBUG [721]: <b>Factory::CommitTransaction()</b>: CommitTransaction(): Transaction Count: 1 Trans Off: 1<br>
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

DEBUG [276]: <b>[Function]()</b>: Recurring Schedule Shift Start Time DOES NOT fall within Limits: 16-Jul-07 8:30 AM EDT<br>
DEBUG [75]: <b>[Function]()</b>: aaI: 0/4 User ID: 2<br>
Unfortunately running the script is time dependent, as you can see when you ran it you were outside the limits of the scheduled shift, so TimeTrex didn't actually do anything (by design), so that debug output didn't help.

Can you try to run the script before the time that the employees are scheduled to start their shift? It may also work after, but that depends on a lot more factors.

We don't like to see problems persist for more then a couple days, is it possible to give us access to your server so we can login and diagnose this problem in real-time? If so, please email the information to support@timetrex.com.
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

I tried the SQL dump you sent us, and it works fine on our servers here. I ran:

Code: Select all

php AddRecurringScheduleShift.php
and it immediately inserted the schedule for all four employees and punched them in as well.

So if its still not working for you, it must be something specific to your system.

Try running it again and sending us the FULL debug output (including debug buffer), if you run it before the end of the day it should attempt to actually insert the shifts. Before you do this though, I would try clearing your TimeTrex cache directory, "just in case".
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

I cleared the tmp/timetrex cache directory and re-ran it several times and received the same sql commands that I sent you earlier but no debug listed output. I tried logging back in to the system with debug on and this appeared on the screen. Maybe it has something to do with the locale error?
Debug Buffer
============================================================================
Memory Usage: 2861464
----------------------------------------------------------------------------
DEBUG [200]: [Function](): URI: /TimeTrex/interface//Login.php
DEBUG [202]: [Function](): Production: 1
DEBUG [50]: [Function](): Bypassing Authentication
DEBUG [345]: TTi18n::chooseBestLocale(): Choosing Best Locale...
DEBUG [398]: TTi18n::chooseBestLocale(): cSetting Locale: en_US
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: en_US Category: 6 Current Locale:
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en_US
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: en_US
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [286]: TTi18n::setLocale(): Failed setting translator locale: en_US
DEBUG [398]: TTi18n::chooseBestLocale(): cSetting Locale: en
DEBUG [267]: TTi18n::setLocale(): Attempting to set Locale to: en Category: 6 Current Locale:
DEBUG [270]: TTi18n::setLocale(): Attempting to set Locale to: en
DEBUG [272]: TTi18n::setLocale(): Failed setting i18n locale: en
DEBUG [284]: TTi18n::setLocale(): Setting translator normalized locale to: en_US
DEBUG [286]: TTi18n::setLocale(): Failed setting translator locale: en_US
DEBUG [409]: TTi18n::chooseBestLocale(): Unable to find and set a locale.
DEBUG [232]: TTi18n::getLanguageFromLocale(): Locale:
============================================================================

============================================================================
PROFILER OUTPUT
============================================================================
Calls Time Routine
-----------------------------------------------------------------------------
1 0.0000 ms (0.00 %) unprofiled

92.3650 ms (100.00 %) Missed
============================================================================
92.3650 ms (100.00 %) OVERALL TIME
============================================================================
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

The locale issue shouldn't affect things, and is infact normal.

Unfortunately because the script depends a lot on the time it is run, it can be hard to get the information we need. If you are comfortable modifying files, we could force the time to something that gets us the data we need.

If you edit: AddRecurringScheduleShift.php

And near the top you should see a line like this:

Code: Select all

//$current_epoch = strtotime('06-Apr-07 6:00 AM');
If you modify that line to look like this:

Code: Select all

$current_epoch = strtotime('18-Jul-07 6:00 AM');


This forces the script to think that it is currently July 18th at 6AM, which should be right on time to add scheduled shifts starting at 8AM.

Then re-run AddRecurringScheduleShift.php with debugging on and it should hopefully get us the data we need.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

I have tried to run the script with the changes that you suggested after removing the timetrex cache files and the output does not include Debug Buffer text just the SQL queries. My timetrex.ini.php file debug section entries are:
production = FALSE
enable = TRUE
enable_display = TRUE
buffer_output = TRUE
enable_log = TRUE
verbosity = 11

What am I missing?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

It turns out the problem was due to your memory limit set to 8M for your PHP CLI binary. For whatever reason it wasn't showing the actual error on the screen though, even though display_errors was enabled. Not quite sure about that.

Anyways, I increased the memory limit to 256M (just to be safe) in /etc/php5/cli/php.ini and the script executed as normal, and should have inserted the schedule/punches for July 17th.

Enjoy.
rons
Posts: 52
Joined: Fri Jul 06, 2007 11:24 am

Post by rons »

Thanks for all your help on this issue. Your support is outstanding. I am anxious to complete our evaluation so that we can start using it in place of our outside payroll service.
Locked