Ignore:
Timestamp:
05/18/13 18:25:10 (11 years ago)
Author:
ramonb
Message:

libtoga.php:

  • allow searchDbase query to include running jobs

templates/search.tpl:

  • added "include running jobs" checkbox

search.php:

  • pass include running option submit to searchDbase
  • some modifications to start/stop times for running jobs
  • closes #167
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/web/addons/job_monarch/libtoga.php

    r874 r880  
    211211    }
    212212
    213     function searchDbase( $id = null, $queue = null, $owner = null, $name = null, $start_from_time = null, $start_to_time = null, $end_from_time = null, $end_to_time = null )
     213    function searchDbase( $id = null, $queue = null, $owner = null, $name = null, $start_from_time = null, $start_to_time = null, $end_from_time = null, $end_to_time = null, $include_running = false )
    214214    {
    215215        global $SEARCH_RESULT_LIMIT;
    216216
     217        if( $include_running )
     218        {
     219            $status_query = " AND job_status != 'Q'";
     220        }
     221        else
     222        {
     223            $status_query = " AND job_status = 'F'";
     224        }
     225
    217226        if( $id )
    218227        {
    219             $select_query = "SELECT job_id FROM jobs WHERE job_id = '$id' AND job_status = 'F'";
     228            $select_query = "SELECT job_id FROM jobs WHERE job_id = '$id'" . $status_query;
    220229            $this->resultcount = 1;
    221230        }
     
    253262            }
    254263
    255             $query = "FROM jobs WHERE job_status = 'F' AND ";
     264            $query = "FROM jobs WHERE ";
    256265            $extra_query_args = '';
    257266
     
    267276                }
    268277            }
    269             $query .= $extra_query_args;
     278            $query .= $extra_query_args . $status_query;
    270279
    271280            $count_result_idname = "COUNT(job_id)";
Note: See TracChangeset for help on using the changeset viewer.