You are here

function _support_pm_dates in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support_pm/support_pm.module \_support_pm_dates()

Return array of days, $timestamp => $day where $timestamp is the first second of the named $day.

3 calls to _support_pm_dates()
support_pm_user_week in support_pm/support_pm.module
Page callback.
support_pm_user_week_submit in support_pm/support_pm.module
Save user's week plan.
theme_support_pm_user_week in support_pm/support_pm.module
TODO: Auto-calculate totals whenever a field is updated.

File

support_pm/support_pm.module, line 961
Support Project Management. @author Jeremy Andrews <jeremy@tag1consulting.com> @package Support

Code

function _support_pm_dates($start = 0) {

  // TODO: Make configurable (ie, disable weekends)
  $day = array(
    t('Sunday'),
    t('Monday'),
    t('Tuesday'),
    t('Wednesday'),
    t('Thursday'),
    t('Friday'),
    t('Saturday'),
  );
  $date = _support_pm_first_day($start);
  $day_of_week = variable_get('date_first_day', 0);

  // Build an array of $timestamp => $day pairs
  for ($i = 0; $i < 7; $i++) {
    $dates[$date] = $day[$day_of_week];
    $date += 86400;
    if (++$day_of_week > 6) {
      $day_of_week = 0;
    }
  }
  return $dates;
}