/[drupal]/contributions/modules/timemap/timemap.module
ViewVC logotype

Diff of /contributions/modules/timemap/timemap.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2, Tue Jun 3 02:34:15 2008 UTC revision 1.3, Wed Jun 11 22:24:40 2008 UTC
# Line 1  Line 1 
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
# Line 462  function timemap_enter_task_form_submit( Line 462  function timemap_enter_task_form_submit(
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)",
# Line 530  function timemap_map($uid = null) { Line 530  function timemap_map($uid = null) {
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    
# Line 639  function timemap_report_choose_person_su Line 639  function timemap_report_choose_person_su
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));

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2