Exemplo n.º 1
0
 public function __construct($ticket_id)
 {
     $this->ticket = Model_Ticket::data_access()->find_by_pk($ticket_id);
     $this->user = APF::get_instance()->get_request()->get_username();
 }
Exemplo n.º 2
0
$solr = Util_SolrFactory::get_instance()->get_solr();
$id = @intval($argv[2]);
if (empty($id)) {
    $id = @intval(file_get_contents('/tmp/ibug_ticket_log_id'));
}
$logs = Bll_TicketLogBiz::get_instance()->get_ticket_ids_great_than_id($id, 500);
if (empty($logs)) {
    echo date('c ') . "No tickets to update\n";
    exit(0);
}
$ticket_ids = array();
foreach ($logs as $ticket_log) {
    $ticket_ids[] = $ticket_log->ticket_id;
}
$id = $ticket_log->id;
$dao = Model_Ticket::data_access();
$ticket_ids = array_unique($ticket_ids);
$tickets = $dao->find_by_pks($ticket_ids);
$tickets = Bll_TicketBiz::get_instance()->process_solr_field($tickets);
$_ticket_ccs = Bll_TicketCcBiz::get_instance()->get_ticket_cc_by_ticket_ids($ticket_ids);
$ticket_ccs = array();
if (!empty($_ticket_ccs)) {
    foreach ($_ticket_ccs as $_ticket_cc) {
        $ticket_ccs[$_ticket_cc->ticket_id][] = $_ticket_cc->cc_to;
    }
}
foreach ($tickets as $ticket_id => $ticket) {
    if (empty($ticket)) {
        try {
            $solr->deleteById($ticket_id);
            echo date('c ') . " Delete ok {$ticket_id}\n";
Exemplo n.º 3
0
 public function get_count_by_function($begin, $end, $function)
 {
     $dao = Model_Ticket::data_access();
     $tickets = $dao->filter_by_op(Model_Ticket::Enviroment, '=', 19);
     $tickets = $tickets->filter(Model_Ticket::Priority, array(7, 11, 80));
     $tickets = $tickets->filter_by_op(Model_Ticket::CreatedAt, '>=', $begin)->filter_by_op(Model_Ticket::CreatedAt, '<=', $end);
     $tickets = $tickets->filter_by_op(Model_Ticket::Component, 'in', $function)->find();
     return count($tickets);
 }