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

Diff of /contributions/modules/casetracker_services/casetracker_services.module

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

revision 1.2.2.7, Fri Apr 4 03:37:39 2008 UTC revision 1.2.2.8, Fri Apr 4 05:28:49 2008 UTC
# Line 426  function casetracker_services_cases($pid Line 426  function casetracker_services_cases($pid
426    $types_in = "'". implode("', '", casetracker_services_case_types()) ."'";    $types_in = "'". implode("', '", casetracker_services_case_types()) ."'";
427    
428    // Restrict returned cases to those opened by the project author?    // Restrict returned cases to those opened by the project author?
429    if (variable_get('casetracker_services_only_authored', false)) {    $key_exclusions = variable_get('casetracker_services_no_restrict_keys', array());
430      $authors_in = casetracker_services_where_projects_authors_in();    $only_authored = (variable_get('casetracker_services_only_authored', false));
431    }  
432    else {    // Start narrow
433      $authors_in = false;    $authors_in = casetracker_services_where_projects_authors_in();
434      if (!$only_authored || in_array(casetracker_services_get_key(), $key_exclusions)) {
435        $authors_in = false; // Don't restrict
436    }    }
437    
438    // Would be nice to be able to get the result set from casetracker_cases_overview(),    // Would be nice to be able to get the result set from casetracker_cases_overview(),
439    // instead we completely ignore that monster and just use some similar SQL.    // instead we completely ignore that monster and just use some similar SQL.
440    $query = "    $query = "
# Line 455  function casetracker_services_cases($pid Line 457  function casetracker_services_cases($pid
457      ORDER BY ncs.last_comment_timestamp DESC      ORDER BY ncs.last_comment_timestamp DESC
458      ";      ";
459    
460    //  watchdog('ct', casetracker_services_get_key() .' '.$query);
461    
462    $result = pager_query($query, 100, 0);    $result = pager_query($query, 100, 0);
463      $rows = array();
464    while ($row = db_fetch_array($result)) {    while ($row = db_fetch_array($result)) {
465      $rows[] = $row;      $rows[] = $row;
466    }    }
# Line 485  function casetracker_services_where_proj Line 490  function casetracker_services_where_proj
490  function casetracker_services_where_projects_authors_in() {  function casetracker_services_where_projects_authors_in() {
491    $projects_in = casetracker_services_where_projects_in();    $projects_in = casetracker_services_where_projects_in();
492    $results = db_query('SELECT DISTINCT uid FROM {node} WHERE nid IN ('. $projects_in .')');    $results = db_query('SELECT DISTINCT uid FROM {node} WHERE nid IN ('. $projects_in .')');
493      $authors = array();
494    while ($row = db_fetch_array($results)) {    while ($row = db_fetch_array($results)) {
495      $authors[] = $row['uid'];      $authors[] = $row['uid'];
496    }    }

Legend:
Removed from v.1.2.2.7  
changed lines
  Added in v.1.2.2.8

  ViewVC Help
Powered by ViewVC 1.1.2