2c2
< // $Id: job_queue.module,v 1.1.2.7 2008/03/11 19:04:20 drumm Exp $
---
> // $Id$
6c6
< function job_queue_menu($may_cache) {
---
> function job_queue_menu() {
8,26c8,20
< 
<   if ($may_cache) {
<     $items[] = array(
<       'path' => 'admin/logs/job_queue',
<       'title' => t('Queued jobs'),
<       'description' => t('View a list of the queued jobs.'),
<       'callback' => 'job_queue_list',
<       'access' => user_access('view queued jobs'),
<     );
<     $items[] = array(
<       'path' => 'admin/settings/job_queue',
<       'title' => t('Job queue'),
<       'description' => t('Set queue priorities.'),
<       'callback' => 'drupal_get_form',
<       'callback arguments' => array('job_queue_settings_form'),
<       'access' => user_access('administer job queue'),
<     );
<   }
< 
---
>   $items['admin/reports/job_queue'] = array(
>     'title' => t('Queued jobs'),
>     'description' => t('View a list of the queued jobs.'),
>     'page callback' => 'job_queue_list',
>     'access arguments' => array('view queued jobs'),
>   );
>   $items['admin/settings/job_queue'] = array(
>     'title' => t('Job queue'),
>     'description' => t('Set queue priorities.'),
>     'page callback' => 'drupal_get_form',
>     'page arguments' => array('job_queue_settings_form'),
>     'access arguments' => array('administer job queue'),
>   );
33a28
> 
79c74,75
<   db_query("INSERT INTO {job_queue} (jqid, created, description, function, arguments, file, priority) VALUES (%d, %d, '%s', '%s', '%s', '%s', %d)", db_next_id('{job_queue}_jqid'), time(), $description, $function, serialize($arguments), $file, $priorities[$function]);
---
>   db_query("INSERT INTO {job_queue} (jqid, created, description, function, arguments, file, priority) VALUES (%d, %d, '%s', '%s', '%s', '%s', %d)", db_last_insert_id('job_queue', 'jqid'), time(), $description, $function, serialize($arguments), $file, $priorities[$function]);
> 
89,90c85,86
<   $result = db_query_range('SELECT jqid, description, function, arguments, file FROM {job_queue} WHERE priority <> %d ORDER BY priority, jqid', JOB_QUEUE_DO_NOT_RUN, 0, 1);
<   if (db_num_rows($result) > 0) {
---
>   if (db_result(db_query("SELECT COUNT(jqid) FROM {job_queue} WHERE priority <> %d", JOB_QUEUE_DO_NOT_RUN)) > 0) {
>     $result = db_query_range("SELECT jqid, description, function, arguments, file FROM {job_queue} WHERE priority <> %d ORDER BY '%s', '%s'", JOB_QUEUE_DO_NOT_RUN, 'priority', 'jqid', 0, 1);
100c96
<       watchdog('job_queue', t('Failed to run queued job "!description" because the function %function is not defined.', array('!description' => $job->description, '%function' => $job->function)), WATCHDOG_ERROR);
---
>       watchdog('job_queue', 'Failed to run queued job "!description" because the function %function is not defined.', array('!description' => $job->description, '%function' => $job->function), WATCHDOG_ERROR);
122c118,119
<     $output = '<p>'. t('There are <strong>no queued jobs</strong>. Modules may programmatically add queued jobs.') .'</p>';
---
>     $output = '<p>'. t('There are <strong>no queued jobs</strong>.') .'</p>';
>     $output .= '<p>'. t('Modules may programmatically add queued jobs. See the !readme_link file for an example of how to do this.', array('!readme_link' => l('README.txt', drupal_get_path('module', 'job_queue') .'/README.txt'))) .'</p>';
