| 1 |
<?php |
<?php |
| 2 |
// $Id: timemap.module,v 1.1 2008/06/02 03:43:49 sethfreach Exp $ |
// $Id: timemap.module,v 1.2 2008/06/03 02:34:15 sethfreach Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 462 |
// if so, enter a negative value for the category. the text is informational only. |
// if so, enter a negative value for the category. the text is informational only. |
| 463 |
if ($form_values['op'] == $form_values['done']) { |
if ($form_values['op'] == $form_values['done']) { |
| 464 |
// end the last 'task' entered |
// end the last 'task' entered |
| 465 |
db_query_range("update {timemap_doings} set stop=%d where uid=%d order by time desc limit 1", time(), $user->uid); |
db_query("update {timemap_doings} set stop=%d where uid=%d order by time desc limit 1", time(), $user->uid); |
| 466 |
|
|
| 467 |
// record the 'punch clock' stamp |
// record the 'punch clock' stamp |
| 468 |
db_query("insert into {timemap_doings} (uid, cid, task, time) values (%d, %d, '%s', %d)", |
db_query("insert into {timemap_doings} (uid, cid, task, time) values (%d, %d, '%s', %d)", |
| 530 |
drupal_add_js(drupal_get_path('module', 'timemap') ."/timemap_simile-timeline.js"); |
drupal_add_js(drupal_get_path('module', 'timemap') ."/timemap_simile-timeline.js"); |
| 531 |
drupal_add_css(drupal_get_path('module', 'timemap') ."/timemap.css"); |
drupal_add_css(drupal_get_path('module', 'timemap') ."/timemap.css"); |
| 532 |
|
|
| 533 |
return $people_chooser .'<div id="timemap" uid="'. $uid .'" offset="'. $user->timezone .'"></div><div class="timemap_controls" id="timemap_controls"></div>'; |
return $people_chooser .'<div id="timemap" basepath="'. base_path() .'" uid="'. $uid .'" offset="'. $user->timezone .'"></div><div class="timemap_controls" id="timemap_controls"></div>'; |
| 534 |
|
|
| 535 |
} |
} |
| 536 |
|
|
| 639 |
function timemap_viewable_reports_list() { |
function timemap_viewable_reports_list() { |
| 640 |
global $user; |
global $user; |
| 641 |
|
|
| 642 |
|
if ($user->uid == 1) { |
| 643 |
|
$names = array(1, $user->name); |
| 644 |
|
} |
| 645 |
// view all? |
// view all? |
| 646 |
if (user_access('view all reports')) { |
if ( user_access('view all reports') || ($user->uid == 1) ) { |
| 647 |
$result = db_query("select distinct uid from {timemap_doings}"); |
$result = db_query("select distinct uid from {timemap_doings}"); |
| 648 |
while ($row = db_fetch_object($result)) { |
while ($row = db_fetch_object($result)) { |
| 649 |
$userrec = user_load(array('uid' => $row->uid)); |
$userrec = user_load(array('uid' => $row->uid)); |